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,java.io.Externalizable,java.io.Serializable
public class TShortLinkedList extends java.lang.Object implements gnu.trove.list.TShortList, java.io.ExternalizableA resizable, double linked list of short primitives.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TShortLinkedList()TShortLinkedList(short no_entry_value)TShortLinkedList(gnu.trove.list.TShortList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(short val)voidadd(short[] vals)voidadd(short[] vals, int offset, int length)booleanaddAll(short[] array)booleanaddAll(gnu.trove.TShortCollection collection)booleanaddAll(java.util.Collection<? extends java.lang.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(java.util.Collection<?> collection)booleanequals(java.lang.Object other)voidfill(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.shortgetNoEntryValue()gnu.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()voidreadExternal(java.io.ObjectInput in)voidremove(int offset, int length)booleanremove(short value)booleanremoveAll(short[] array)booleanremoveAll(gnu.trove.TShortCollection collection)booleanremoveAll(java.util.Collection<?> collection)shortremoveAt(int offset)shortreplace(int offset, short val)booleanretainAll(short[] array)booleanretainAll(gnu.trove.TShortCollection collection)booleanretainAll(java.util.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)voidshuffle(java.util.Random rand)intsize()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)java.lang.StringtoString()voidtransformValues(gnu.trove.function.TShortFunction function)voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
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
public boolean containsAll(java.util.Collection<?> collection)
- 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
public boolean addAll(java.util.Collection<? extends java.lang.Short> collection)
- 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
public boolean retainAll(java.util.Collection<?> collection)
- 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
public boolean removeAll(java.util.Collection<?> collection)
- 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
public void shuffle(java.util.Random rand)
- 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
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equalsin interfacegnu.trove.TShortCollection- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacegnu.trove.TShortCollection- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-