Package gnu.trove.list.linked
Class TShortLinkedList
java.lang.Object
gnu.trove.list.linked.TShortLinkedList
- All Implemented Interfaces:
gnu.trove.list.TShortList,gnu.trove.TShortCollection,Externalizable,Serializable
A resizable, double linked list of short primitives.
- See Also:
-
Field Summary
Fields inherited from interface gnu.trove.TShortCollection
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionTShortLinkedList(short no_entry_value) TShortLinkedList(gnu.trove.list.TShortList list) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(short val) voidadd(short[] vals) voidadd(short[] vals, int offset, int length) booleanaddAll(short[] array) booleanaddAll(gnu.trove.TShortCollection collection) booleanaddAll(Collection<? extends Short> collection) intbinarySearch(short value) intbinarySearch(short value, int fromIndex, int toIndex) voidclear()booleancontains(short value) booleancontainsAll(short[] array) booleancontainsAll(gnu.trove.TShortCollection collection) booleancontainsAll(Collection<?> collection) booleanvoidfill(int fromIndex, int toIndex, short val) voidfill(short val) booleanforEach(gnu.trove.procedure.TShortProcedure procedure) booleanforEachDescending(gnu.trove.procedure.TShortProcedure procedure) shortget(int offset) gnu.trove.list.linked.TShortLinkedList.TShortLinkgetLinkAt(int offset) Returns the link at the given offset.shortgnu.trove.list.TShortListgrep(gnu.trove.procedure.TShortProcedure condition) inthashCode()intindexOf(int offset, short value) intindexOf(short value) voidinsert(int offset, short value) voidinsert(int offset, short[] values) voidinsert(int offset, short[] values, int valOffset, int len) gnu.trove.list.TShortListinverseGrep(gnu.trove.procedure.TShortProcedure condition) booleanisEmpty()gnu.trove.iterator.TShortIteratoriterator()intlastIndexOf(int offset, short value) intlastIndexOf(short value) shortmax()shortmin()voidvoidremove(int offset, int length) booleanremove(short value) booleanremoveAll(short[] array) booleanremoveAll(gnu.trove.TShortCollection collection) booleanremoveAll(Collection<?> collection) shortremoveAt(int offset) shortreplace(int offset, short val) booleanretainAll(short[] array) booleanretainAll(gnu.trove.TShortCollection collection) booleanretainAll(Collection<?> collection) voidreverse()voidreverse(int from, int to) shortset(int offset, short val) voidset(int offset, short[] values) voidset(int offset, short[] values, int valOffset, int length) voidintsize()voidsort()voidsort(int fromIndex, int toIndex) gnu.trove.list.TShortListsubList(int begin, int end) shortsum()short[]toArray()short[]toArray(int offset, int len) short[]toArray(short[] dest) short[]toArray(short[] dest, int offset, int len) short[]toArray(short[] dest, int source_pos, int dest_pos, int len) toString()voidtransformValues(gnu.trove.function.TShortFunction function) void
-
Constructor Details
-
TShortLinkedList
public TShortLinkedList() -
TShortLinkedList
public TShortLinkedList(short no_entry_value) -
TShortLinkedList
public TShortLinkedList(gnu.trove.list.TShortList list)
-
-
Method Details
-
getNoEntryValue
public short getNoEntryValue()- Specified by:
getNoEntryValuein interfacegnu.trove.TShortCollection- Specified by:
getNoEntryValuein interfacegnu.trove.list.TShortList
-
size
public int size()- Specified by:
sizein interfacegnu.trove.TShortCollection- Specified by:
sizein interfacegnu.trove.list.TShortList
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacegnu.trove.TShortCollection- Specified by:
isEmptyin interfacegnu.trove.list.TShortList
-
add
public boolean add(short val) - Specified by:
addin interfacegnu.trove.TShortCollection- Specified by:
addin interfacegnu.trove.list.TShortList
-
add
public void add(short[] vals) - Specified by:
addin interfacegnu.trove.list.TShortList
-
add
public void add(short[] vals, int offset, int length) - Specified by:
addin interfacegnu.trove.list.TShortList
-
insert
public void insert(int offset, short value) - Specified by:
insertin interfacegnu.trove.list.TShortList
-
insert
public void insert(int offset, short[] values) - Specified by:
insertin interfacegnu.trove.list.TShortList
-
insert
public void insert(int offset, short[] values, int valOffset, int len) - Specified by:
insertin interfacegnu.trove.list.TShortList
-
get
public short get(int offset) - Specified by:
getin interfacegnu.trove.list.TShortList
-
getLinkAt
public gnu.trove.list.linked.TShortLinkedList.TShortLink getLinkAt(int offset) Returns the link at the given offset.
A simple bisection criteria is used to keep the worst case complexity equal to O(n/2) where n = size(). Simply start from head of list or tail depending on offset and list size.
- Parameters:
offset- of the link- Returns:
- link or null if non-existent
-
set
public short set(int offset, short val) - Specified by:
setin interfacegnu.trove.list.TShortList
-
set
public void set(int offset, short[] values) - Specified by:
setin interfacegnu.trove.list.TShortList
-
set
public void set(int offset, short[] values, int valOffset, int length) - Specified by:
setin interfacegnu.trove.list.TShortList
-
replace
public short replace(int offset, short val) - Specified by:
replacein interfacegnu.trove.list.TShortList
-
clear
public void clear()- Specified by:
clearin interfacegnu.trove.TShortCollection- Specified by:
clearin interfacegnu.trove.list.TShortList
-
remove
public boolean remove(short value) - Specified by:
removein interfacegnu.trove.TShortCollection- Specified by:
removein interfacegnu.trove.list.TShortList
-
containsAll
- Specified by:
containsAllin interfacegnu.trove.TShortCollection
-
containsAll
public boolean containsAll(gnu.trove.TShortCollection collection) - Specified by:
containsAllin interfacegnu.trove.TShortCollection
-
containsAll
public boolean containsAll(short[] array) - Specified by:
containsAllin interfacegnu.trove.TShortCollection
-
addAll
- Specified by:
addAllin interfacegnu.trove.TShortCollection
-
addAll
public boolean addAll(gnu.trove.TShortCollection collection) - Specified by:
addAllin interfacegnu.trove.TShortCollection
-
addAll
public boolean addAll(short[] array) - Specified by:
addAllin interfacegnu.trove.TShortCollection
-
retainAll
- Specified by:
retainAllin interfacegnu.trove.TShortCollection
-
retainAll
public boolean retainAll(gnu.trove.TShortCollection collection) - Specified by:
retainAllin interfacegnu.trove.TShortCollection
-
retainAll
public boolean retainAll(short[] array) - Specified by:
retainAllin interfacegnu.trove.TShortCollection
-
removeAll
- Specified by:
removeAllin interfacegnu.trove.TShortCollection
-
removeAll
public boolean removeAll(gnu.trove.TShortCollection collection) - Specified by:
removeAllin interfacegnu.trove.TShortCollection
-
removeAll
public boolean removeAll(short[] array) - Specified by:
removeAllin interfacegnu.trove.TShortCollection
-
removeAt
public short removeAt(int offset) - Specified by:
removeAtin interfacegnu.trove.list.TShortList
-
remove
public void remove(int offset, int length) - Specified by:
removein interfacegnu.trove.list.TShortList
-
transformValues
public void transformValues(gnu.trove.function.TShortFunction function) - Specified by:
transformValuesin interfacegnu.trove.list.TShortList
-
reverse
public void reverse()- Specified by:
reversein interfacegnu.trove.list.TShortList
-
reverse
public void reverse(int from, int to) - Specified by:
reversein interfacegnu.trove.list.TShortList
-
shuffle
- Specified by:
shufflein interfacegnu.trove.list.TShortList
-
subList
public gnu.trove.list.TShortList subList(int begin, int end) - Specified by:
subListin interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray()- Specified by:
toArrayin interfacegnu.trove.TShortCollection- Specified by:
toArrayin interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(int offset, int len) - Specified by:
toArrayin interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(short[] dest) - Specified by:
toArrayin interfacegnu.trove.TShortCollection- Specified by:
toArrayin interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(short[] dest, int offset, int len) - Specified by:
toArrayin interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(short[] dest, int source_pos, int dest_pos, int len) - Specified by:
toArrayin interfacegnu.trove.list.TShortList
-
forEach
public boolean forEach(gnu.trove.procedure.TShortProcedure procedure) - Specified by:
forEachin interfacegnu.trove.TShortCollection- Specified by:
forEachin interfacegnu.trove.list.TShortList
-
forEachDescending
public boolean forEachDescending(gnu.trove.procedure.TShortProcedure procedure) - Specified by:
forEachDescendingin interfacegnu.trove.list.TShortList
-
sort
public void sort()- Specified by:
sortin interfacegnu.trove.list.TShortList
-
sort
public void sort(int fromIndex, int toIndex) - Specified by:
sortin interfacegnu.trove.list.TShortList
-
fill
public void fill(short val) - Specified by:
fillin interfacegnu.trove.list.TShortList
-
fill
public void fill(int fromIndex, int toIndex, short val) - Specified by:
fillin interfacegnu.trove.list.TShortList
-
binarySearch
public int binarySearch(short value) - Specified by:
binarySearchin interfacegnu.trove.list.TShortList
-
binarySearch
public int binarySearch(short value, int fromIndex, int toIndex) - Specified by:
binarySearchin interfacegnu.trove.list.TShortList
-
indexOf
public int indexOf(short value) - Specified by:
indexOfin interfacegnu.trove.list.TShortList
-
indexOf
public int indexOf(int offset, short value) - Specified by:
indexOfin interfacegnu.trove.list.TShortList
-
lastIndexOf
public int lastIndexOf(short value) - Specified by:
lastIndexOfin interfacegnu.trove.list.TShortList
-
lastIndexOf
public int lastIndexOf(int offset, short value) - Specified by:
lastIndexOfin interfacegnu.trove.list.TShortList
-
contains
public boolean contains(short value) - Specified by:
containsin interfacegnu.trove.TShortCollection- Specified by:
containsin interfacegnu.trove.list.TShortList
-
iterator
public gnu.trove.iterator.TShortIterator iterator()- Specified by:
iteratorin interfacegnu.trove.TShortCollection
-
grep
public gnu.trove.list.TShortList grep(gnu.trove.procedure.TShortProcedure condition) - Specified by:
grepin interfacegnu.trove.list.TShortList
-
inverseGrep
public gnu.trove.list.TShortList inverseGrep(gnu.trove.procedure.TShortProcedure condition) - Specified by:
inverseGrepin interfacegnu.trove.list.TShortList
-
max
public short max()- Specified by:
maxin interfacegnu.trove.list.TShortList
-
min
public short min()- Specified by:
minin interfacegnu.trove.list.TShortList
-
sum
public short sum()- Specified by:
sumin interfacegnu.trove.list.TShortList
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
equals
-
hashCode
public int hashCode() -
toString
-