Package gnu.trove.list.linked
Class TLongLinkedList
java.lang.Object
gnu.trove.list.linked.TLongLinkedList
- All Implemented Interfaces:
gnu.trove.list.TLongList,gnu.trove.TLongCollection,Externalizable,Serializable
A resizable, double linked list of long primitives.
- See Also:
-
Field Summary
Fields inherited from interface gnu.trove.TLongCollection
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionTLongLinkedList(long no_entry_value) TLongLinkedList(gnu.trove.list.TLongList list) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(long val) voidadd(long[] vals) voidadd(long[] vals, int offset, int length) booleanaddAll(long[] array) booleanaddAll(gnu.trove.TLongCollection collection) booleanaddAll(Collection<? extends Long> collection) intbinarySearch(long value) intbinarySearch(long value, int fromIndex, int toIndex) voidclear()booleancontains(long value) booleancontainsAll(long[] array) booleancontainsAll(gnu.trove.TLongCollection collection) booleancontainsAll(Collection<?> collection) booleanvoidfill(int fromIndex, int toIndex, long val) voidfill(long val) booleanforEach(gnu.trove.procedure.TLongProcedure procedure) booleanforEachDescending(gnu.trove.procedure.TLongProcedure procedure) longget(int offset) gnu.trove.list.linked.TLongLinkedList.TLongLinkgetLinkAt(int offset) Returns the link at the given offset.longgnu.trove.list.TLongListgrep(gnu.trove.procedure.TLongProcedure condition) inthashCode()intindexOf(int offset, long value) intindexOf(long value) voidinsert(int offset, long value) voidinsert(int offset, long[] values) voidinsert(int offset, long[] values, int valOffset, int len) gnu.trove.list.TLongListinverseGrep(gnu.trove.procedure.TLongProcedure condition) booleanisEmpty()gnu.trove.iterator.TLongIteratoriterator()intlastIndexOf(int offset, long value) intlastIndexOf(long value) longmax()longmin()voidvoidremove(int offset, int length) booleanremove(long value) booleanremoveAll(long[] array) booleanremoveAll(gnu.trove.TLongCollection collection) booleanremoveAll(Collection<?> collection) longremoveAt(int offset) longreplace(int offset, long val) booleanretainAll(long[] array) booleanretainAll(gnu.trove.TLongCollection collection) booleanretainAll(Collection<?> collection) voidreverse()voidreverse(int from, int to) longset(int offset, long val) voidset(int offset, long[] values) voidset(int offset, long[] values, int valOffset, int length) voidintsize()voidsort()voidsort(int fromIndex, int toIndex) gnu.trove.list.TLongListsubList(int begin, int end) longsum()long[]toArray()long[]toArray(int offset, int len) long[]toArray(long[] dest) long[]toArray(long[] dest, int offset, int len) long[]toArray(long[] dest, int source_pos, int dest_pos, int len) toString()voidtransformValues(gnu.trove.function.TLongFunction function) void
-
Constructor Details
-
TLongLinkedList
public TLongLinkedList() -
TLongLinkedList
public TLongLinkedList(long no_entry_value) -
TLongLinkedList
public TLongLinkedList(gnu.trove.list.TLongList list)
-
-
Method Details
-
getNoEntryValue
public long getNoEntryValue()- Specified by:
getNoEntryValuein interfacegnu.trove.TLongCollection- Specified by:
getNoEntryValuein interfacegnu.trove.list.TLongList
-
size
public int size()- Specified by:
sizein interfacegnu.trove.TLongCollection- Specified by:
sizein interfacegnu.trove.list.TLongList
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacegnu.trove.TLongCollection- Specified by:
isEmptyin interfacegnu.trove.list.TLongList
-
add
public boolean add(long val) - Specified by:
addin interfacegnu.trove.TLongCollection- Specified by:
addin interfacegnu.trove.list.TLongList
-
add
public void add(long[] vals) - Specified by:
addin interfacegnu.trove.list.TLongList
-
add
public void add(long[] vals, int offset, int length) - Specified by:
addin interfacegnu.trove.list.TLongList
-
insert
public void insert(int offset, long value) - Specified by:
insertin interfacegnu.trove.list.TLongList
-
insert
public void insert(int offset, long[] values) - Specified by:
insertin interfacegnu.trove.list.TLongList
-
insert
public void insert(int offset, long[] values, int valOffset, int len) - Specified by:
insertin interfacegnu.trove.list.TLongList
-
get
public long get(int offset) - Specified by:
getin interfacegnu.trove.list.TLongList
-
getLinkAt
public gnu.trove.list.linked.TLongLinkedList.TLongLink 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 long set(int offset, long val) - Specified by:
setin interfacegnu.trove.list.TLongList
-
set
public void set(int offset, long[] values) - Specified by:
setin interfacegnu.trove.list.TLongList
-
set
public void set(int offset, long[] values, int valOffset, int length) - Specified by:
setin interfacegnu.trove.list.TLongList
-
replace
public long replace(int offset, long val) - Specified by:
replacein interfacegnu.trove.list.TLongList
-
clear
public void clear()- Specified by:
clearin interfacegnu.trove.TLongCollection- Specified by:
clearin interfacegnu.trove.list.TLongList
-
remove
public boolean remove(long value) - Specified by:
removein interfacegnu.trove.TLongCollection- Specified by:
removein interfacegnu.trove.list.TLongList
-
containsAll
- Specified by:
containsAllin interfacegnu.trove.TLongCollection
-
containsAll
public boolean containsAll(gnu.trove.TLongCollection collection) - Specified by:
containsAllin interfacegnu.trove.TLongCollection
-
containsAll
public boolean containsAll(long[] array) - Specified by:
containsAllin interfacegnu.trove.TLongCollection
-
addAll
- Specified by:
addAllin interfacegnu.trove.TLongCollection
-
addAll
public boolean addAll(gnu.trove.TLongCollection collection) - Specified by:
addAllin interfacegnu.trove.TLongCollection
-
addAll
public boolean addAll(long[] array) - Specified by:
addAllin interfacegnu.trove.TLongCollection
-
retainAll
- Specified by:
retainAllin interfacegnu.trove.TLongCollection
-
retainAll
public boolean retainAll(gnu.trove.TLongCollection collection) - Specified by:
retainAllin interfacegnu.trove.TLongCollection
-
retainAll
public boolean retainAll(long[] array) - Specified by:
retainAllin interfacegnu.trove.TLongCollection
-
removeAll
- Specified by:
removeAllin interfacegnu.trove.TLongCollection
-
removeAll
public boolean removeAll(gnu.trove.TLongCollection collection) - Specified by:
removeAllin interfacegnu.trove.TLongCollection
-
removeAll
public boolean removeAll(long[] array) - Specified by:
removeAllin interfacegnu.trove.TLongCollection
-
removeAt
public long removeAt(int offset) - Specified by:
removeAtin interfacegnu.trove.list.TLongList
-
remove
public void remove(int offset, int length) - Specified by:
removein interfacegnu.trove.list.TLongList
-
transformValues
public void transformValues(gnu.trove.function.TLongFunction function) - Specified by:
transformValuesin interfacegnu.trove.list.TLongList
-
reverse
public void reverse()- Specified by:
reversein interfacegnu.trove.list.TLongList
-
reverse
public void reverse(int from, int to) - Specified by:
reversein interfacegnu.trove.list.TLongList
-
shuffle
- Specified by:
shufflein interfacegnu.trove.list.TLongList
-
subList
public gnu.trove.list.TLongList subList(int begin, int end) - Specified by:
subListin interfacegnu.trove.list.TLongList
-
toArray
public long[] toArray()- Specified by:
toArrayin interfacegnu.trove.TLongCollection- Specified by:
toArrayin interfacegnu.trove.list.TLongList
-
toArray
public long[] toArray(int offset, int len) - Specified by:
toArrayin interfacegnu.trove.list.TLongList
-
toArray
public long[] toArray(long[] dest) - Specified by:
toArrayin interfacegnu.trove.TLongCollection- Specified by:
toArrayin interfacegnu.trove.list.TLongList
-
toArray
public long[] toArray(long[] dest, int offset, int len) - Specified by:
toArrayin interfacegnu.trove.list.TLongList
-
toArray
public long[] toArray(long[] dest, int source_pos, int dest_pos, int len) - Specified by:
toArrayin interfacegnu.trove.list.TLongList
-
forEach
public boolean forEach(gnu.trove.procedure.TLongProcedure procedure) - Specified by:
forEachin interfacegnu.trove.TLongCollection- Specified by:
forEachin interfacegnu.trove.list.TLongList
-
forEachDescending
public boolean forEachDescending(gnu.trove.procedure.TLongProcedure procedure) - Specified by:
forEachDescendingin interfacegnu.trove.list.TLongList
-
sort
public void sort()- Specified by:
sortin interfacegnu.trove.list.TLongList
-
sort
public void sort(int fromIndex, int toIndex) - Specified by:
sortin interfacegnu.trove.list.TLongList
-
fill
public void fill(long val) - Specified by:
fillin interfacegnu.trove.list.TLongList
-
fill
public void fill(int fromIndex, int toIndex, long val) - Specified by:
fillin interfacegnu.trove.list.TLongList
-
binarySearch
public int binarySearch(long value) - Specified by:
binarySearchin interfacegnu.trove.list.TLongList
-
binarySearch
public int binarySearch(long value, int fromIndex, int toIndex) - Specified by:
binarySearchin interfacegnu.trove.list.TLongList
-
indexOf
public int indexOf(long value) - Specified by:
indexOfin interfacegnu.trove.list.TLongList
-
indexOf
public int indexOf(int offset, long value) - Specified by:
indexOfin interfacegnu.trove.list.TLongList
-
lastIndexOf
public int lastIndexOf(long value) - Specified by:
lastIndexOfin interfacegnu.trove.list.TLongList
-
lastIndexOf
public int lastIndexOf(int offset, long value) - Specified by:
lastIndexOfin interfacegnu.trove.list.TLongList
-
contains
public boolean contains(long value) - Specified by:
containsin interfacegnu.trove.TLongCollection- Specified by:
containsin interfacegnu.trove.list.TLongList
-
iterator
public gnu.trove.iterator.TLongIterator iterator()- Specified by:
iteratorin interfacegnu.trove.TLongCollection
-
grep
public gnu.trove.list.TLongList grep(gnu.trove.procedure.TLongProcedure condition) - Specified by:
grepin interfacegnu.trove.list.TLongList
-
inverseGrep
public gnu.trove.list.TLongList inverseGrep(gnu.trove.procedure.TLongProcedure condition) - Specified by:
inverseGrepin interfacegnu.trove.list.TLongList
-
max
public long max()- Specified by:
maxin interfacegnu.trove.list.TLongList
-
min
public long min()- Specified by:
minin interfacegnu.trove.list.TLongList
-
sum
public long sum()- Specified by:
sumin interfacegnu.trove.list.TLongList
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
equals
-
hashCode
public int hashCode() -
toString
-