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 TypeMethodDescriptionboolean
add
(short val) void
add
(short[] vals) void
add
(short[] vals, int offset, int length) boolean
addAll
(short[] array) boolean
addAll
(gnu.trove.TShortCollection collection) boolean
addAll
(Collection<? extends Short> collection) int
binarySearch
(short value) int
binarySearch
(short value, int fromIndex, int toIndex) void
clear()
boolean
contains
(short value) boolean
containsAll
(short[] array) boolean
containsAll
(gnu.trove.TShortCollection collection) boolean
containsAll
(Collection<?> collection) boolean
void
fill
(int fromIndex, int toIndex, short val) void
fill
(short val) boolean
forEach
(gnu.trove.procedure.TShortProcedure procedure) boolean
forEachDescending
(gnu.trove.procedure.TShortProcedure procedure) short
get
(int offset) gnu.trove.list.linked.TShortLinkedList.TShortLink
getLinkAt
(int offset) Returns the link at the given offset.short
gnu.trove.list.TShortList
grep
(gnu.trove.procedure.TShortProcedure condition) int
hashCode()
int
indexOf
(int offset, short value) int
indexOf
(short value) void
insert
(int offset, short value) void
insert
(int offset, short[] values) void
insert
(int offset, short[] values, int valOffset, int len) gnu.trove.list.TShortList
inverseGrep
(gnu.trove.procedure.TShortProcedure condition) boolean
isEmpty()
gnu.trove.iterator.TShortIterator
iterator()
int
lastIndexOf
(int offset, short value) int
lastIndexOf
(short value) short
max()
short
min()
void
void
remove
(int offset, int length) boolean
remove
(short value) boolean
removeAll
(short[] array) boolean
removeAll
(gnu.trove.TShortCollection collection) boolean
removeAll
(Collection<?> collection) short
removeAt
(int offset) short
replace
(int offset, short val) boolean
retainAll
(short[] array) boolean
retainAll
(gnu.trove.TShortCollection collection) boolean
retainAll
(Collection<?> collection) void
reverse()
void
reverse
(int from, int to) short
set
(int offset, short val) void
set
(int offset, short[] values) void
set
(int offset, short[] values, int valOffset, int length) void
int
size()
void
sort()
void
sort
(int fromIndex, int toIndex) gnu.trove.list.TShortList
subList
(int begin, int end) short
sum()
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()
void
transformValues
(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:
getNoEntryValue
in interfacegnu.trove.TShortCollection
- Specified by:
getNoEntryValue
in interfacegnu.trove.list.TShortList
-
size
public int size()- Specified by:
size
in interfacegnu.trove.TShortCollection
- Specified by:
size
in interfacegnu.trove.list.TShortList
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfacegnu.trove.TShortCollection
- Specified by:
isEmpty
in interfacegnu.trove.list.TShortList
-
add
public boolean add(short val) - Specified by:
add
in interfacegnu.trove.TShortCollection
- Specified by:
add
in interfacegnu.trove.list.TShortList
-
add
public void add(short[] vals) - Specified by:
add
in interfacegnu.trove.list.TShortList
-
add
public void add(short[] vals, int offset, int length) - Specified by:
add
in interfacegnu.trove.list.TShortList
-
insert
public void insert(int offset, short value) - Specified by:
insert
in interfacegnu.trove.list.TShortList
-
insert
public void insert(int offset, short[] values) - Specified by:
insert
in interfacegnu.trove.list.TShortList
-
insert
public void insert(int offset, short[] values, int valOffset, int len) - Specified by:
insert
in interfacegnu.trove.list.TShortList
-
get
public short get(int offset) - Specified by:
get
in 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:
set
in interfacegnu.trove.list.TShortList
-
set
public void set(int offset, short[] values) - Specified by:
set
in interfacegnu.trove.list.TShortList
-
set
public void set(int offset, short[] values, int valOffset, int length) - Specified by:
set
in interfacegnu.trove.list.TShortList
-
replace
public short replace(int offset, short val) - Specified by:
replace
in interfacegnu.trove.list.TShortList
-
clear
public void clear()- Specified by:
clear
in interfacegnu.trove.TShortCollection
- Specified by:
clear
in interfacegnu.trove.list.TShortList
-
remove
public boolean remove(short value) - Specified by:
remove
in interfacegnu.trove.TShortCollection
- Specified by:
remove
in interfacegnu.trove.list.TShortList
-
containsAll
- Specified by:
containsAll
in interfacegnu.trove.TShortCollection
-
containsAll
public boolean containsAll(gnu.trove.TShortCollection collection) - Specified by:
containsAll
in interfacegnu.trove.TShortCollection
-
containsAll
public boolean containsAll(short[] array) - Specified by:
containsAll
in interfacegnu.trove.TShortCollection
-
addAll
- Specified by:
addAll
in interfacegnu.trove.TShortCollection
-
addAll
public boolean addAll(gnu.trove.TShortCollection collection) - Specified by:
addAll
in interfacegnu.trove.TShortCollection
-
addAll
public boolean addAll(short[] array) - Specified by:
addAll
in interfacegnu.trove.TShortCollection
-
retainAll
- Specified by:
retainAll
in interfacegnu.trove.TShortCollection
-
retainAll
public boolean retainAll(gnu.trove.TShortCollection collection) - Specified by:
retainAll
in interfacegnu.trove.TShortCollection
-
retainAll
public boolean retainAll(short[] array) - Specified by:
retainAll
in interfacegnu.trove.TShortCollection
-
removeAll
- Specified by:
removeAll
in interfacegnu.trove.TShortCollection
-
removeAll
public boolean removeAll(gnu.trove.TShortCollection collection) - Specified by:
removeAll
in interfacegnu.trove.TShortCollection
-
removeAll
public boolean removeAll(short[] array) - Specified by:
removeAll
in interfacegnu.trove.TShortCollection
-
removeAt
public short removeAt(int offset) - Specified by:
removeAt
in interfacegnu.trove.list.TShortList
-
remove
public void remove(int offset, int length) - Specified by:
remove
in interfacegnu.trove.list.TShortList
-
transformValues
public void transformValues(gnu.trove.function.TShortFunction function) - Specified by:
transformValues
in interfacegnu.trove.list.TShortList
-
reverse
public void reverse()- Specified by:
reverse
in interfacegnu.trove.list.TShortList
-
reverse
public void reverse(int from, int to) - Specified by:
reverse
in interfacegnu.trove.list.TShortList
-
shuffle
- Specified by:
shuffle
in interfacegnu.trove.list.TShortList
-
subList
public gnu.trove.list.TShortList subList(int begin, int end) - Specified by:
subList
in interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray()- Specified by:
toArray
in interfacegnu.trove.TShortCollection
- Specified by:
toArray
in interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(int offset, int len) - Specified by:
toArray
in interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(short[] dest) - Specified by:
toArray
in interfacegnu.trove.TShortCollection
- Specified by:
toArray
in interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(short[] dest, int offset, int len) - Specified by:
toArray
in interfacegnu.trove.list.TShortList
-
toArray
public short[] toArray(short[] dest, int source_pos, int dest_pos, int len) - Specified by:
toArray
in interfacegnu.trove.list.TShortList
-
forEach
public boolean forEach(gnu.trove.procedure.TShortProcedure procedure) - Specified by:
forEach
in interfacegnu.trove.TShortCollection
- Specified by:
forEach
in interfacegnu.trove.list.TShortList
-
forEachDescending
public boolean forEachDescending(gnu.trove.procedure.TShortProcedure procedure) - Specified by:
forEachDescending
in interfacegnu.trove.list.TShortList
-
sort
public void sort()- Specified by:
sort
in interfacegnu.trove.list.TShortList
-
sort
public void sort(int fromIndex, int toIndex) - Specified by:
sort
in interfacegnu.trove.list.TShortList
-
fill
public void fill(short val) - Specified by:
fill
in interfacegnu.trove.list.TShortList
-
fill
public void fill(int fromIndex, int toIndex, short val) - Specified by:
fill
in interfacegnu.trove.list.TShortList
-
binarySearch
public int binarySearch(short value) - Specified by:
binarySearch
in interfacegnu.trove.list.TShortList
-
binarySearch
public int binarySearch(short value, int fromIndex, int toIndex) - Specified by:
binarySearch
in interfacegnu.trove.list.TShortList
-
indexOf
public int indexOf(short value) - Specified by:
indexOf
in interfacegnu.trove.list.TShortList
-
indexOf
public int indexOf(int offset, short value) - Specified by:
indexOf
in interfacegnu.trove.list.TShortList
-
lastIndexOf
public int lastIndexOf(short value) - Specified by:
lastIndexOf
in interfacegnu.trove.list.TShortList
-
lastIndexOf
public int lastIndexOf(int offset, short value) - Specified by:
lastIndexOf
in interfacegnu.trove.list.TShortList
-
contains
public boolean contains(short value) - Specified by:
contains
in interfacegnu.trove.TShortCollection
- Specified by:
contains
in interfacegnu.trove.list.TShortList
-
iterator
public gnu.trove.iterator.TShortIterator iterator()- Specified by:
iterator
in interfacegnu.trove.TShortCollection
-
grep
public gnu.trove.list.TShortList grep(gnu.trove.procedure.TShortProcedure condition) - Specified by:
grep
in interfacegnu.trove.list.TShortList
-
inverseGrep
public gnu.trove.list.TShortList inverseGrep(gnu.trove.procedure.TShortProcedure condition) - Specified by:
inverseGrep
in interfacegnu.trove.list.TShortList
-
max
public short max()- Specified by:
max
in interfacegnu.trove.list.TShortList
-
min
public short min()- Specified by:
min
in interfacegnu.trove.list.TShortList
-
sum
public short sum()- Specified by:
sum
in interfacegnu.trove.list.TShortList
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
equals
-
hashCode
public int hashCode() -
toString
-