Package gnu.trove.list.linked
Class TByteLinkedList
- java.lang.Object
-
- gnu.trove.list.linked.TByteLinkedList
-
- All Implemented Interfaces:
gnu.trove.list.TByteList
,gnu.trove.TByteCollection
,java.io.Externalizable
,java.io.Serializable
public class TByteLinkedList extends java.lang.Object implements gnu.trove.list.TByteList, java.io.Externalizable
A resizable, double linked list of byte primitives.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TByteLinkedList()
TByteLinkedList(byte no_entry_value)
TByteLinkedList(gnu.trove.list.TByteList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(byte val)
void
add(byte[] vals)
void
add(byte[] vals, int offset, int length)
boolean
addAll(byte[] array)
boolean
addAll(gnu.trove.TByteCollection collection)
boolean
addAll(java.util.Collection<? extends java.lang.Byte> collection)
int
binarySearch(byte value)
int
binarySearch(byte value, int fromIndex, int toIndex)
void
clear()
boolean
contains(byte value)
boolean
containsAll(byte[] array)
boolean
containsAll(gnu.trove.TByteCollection collection)
boolean
containsAll(java.util.Collection<?> collection)
boolean
equals(java.lang.Object other)
void
fill(byte val)
void
fill(int fromIndex, int toIndex, byte val)
boolean
forEach(gnu.trove.procedure.TByteProcedure procedure)
boolean
forEachDescending(gnu.trove.procedure.TByteProcedure procedure)
byte
get(int offset)
gnu.trove.list.linked.TByteLinkedList.TByteLink
getLinkAt(int offset)
Returns the link at the given offset.byte
getNoEntryValue()
gnu.trove.list.TByteList
grep(gnu.trove.procedure.TByteProcedure condition)
int
hashCode()
int
indexOf(byte value)
int
indexOf(int offset, byte value)
void
insert(int offset, byte value)
void
insert(int offset, byte[] values)
void
insert(int offset, byte[] values, int valOffset, int len)
gnu.trove.list.TByteList
inverseGrep(gnu.trove.procedure.TByteProcedure condition)
boolean
isEmpty()
gnu.trove.iterator.TByteIterator
iterator()
int
lastIndexOf(byte value)
int
lastIndexOf(int offset, byte value)
byte
max()
byte
min()
void
readExternal(java.io.ObjectInput in)
boolean
remove(byte value)
void
remove(int offset, int length)
boolean
removeAll(byte[] array)
boolean
removeAll(gnu.trove.TByteCollection collection)
boolean
removeAll(java.util.Collection<?> collection)
byte
removeAt(int offset)
byte
replace(int offset, byte val)
boolean
retainAll(byte[] array)
boolean
retainAll(gnu.trove.TByteCollection collection)
boolean
retainAll(java.util.Collection<?> collection)
void
reverse()
void
reverse(int from, int to)
byte
set(int offset, byte val)
void
set(int offset, byte[] values)
void
set(int offset, byte[] values, int valOffset, int length)
void
shuffle(java.util.Random rand)
int
size()
void
sort()
void
sort(int fromIndex, int toIndex)
gnu.trove.list.TByteList
subList(int begin, int end)
byte
sum()
byte[]
toArray()
byte[]
toArray(byte[] dest)
byte[]
toArray(byte[] dest, int offset, int len)
byte[]
toArray(byte[] dest, int source_pos, int dest_pos, int len)
byte[]
toArray(int offset, int len)
java.lang.String
toString()
void
transformValues(gnu.trove.function.TByteFunction function)
void
writeExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
getNoEntryValue
public byte getNoEntryValue()
- Specified by:
getNoEntryValue
in interfacegnu.trove.TByteCollection
- Specified by:
getNoEntryValue
in interfacegnu.trove.list.TByteList
-
size
public int size()
- Specified by:
size
in interfacegnu.trove.TByteCollection
- Specified by:
size
in interfacegnu.trove.list.TByteList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacegnu.trove.TByteCollection
- Specified by:
isEmpty
in interfacegnu.trove.list.TByteList
-
add
public boolean add(byte val)
- Specified by:
add
in interfacegnu.trove.TByteCollection
- Specified by:
add
in interfacegnu.trove.list.TByteList
-
add
public void add(byte[] vals)
- Specified by:
add
in interfacegnu.trove.list.TByteList
-
add
public void add(byte[] vals, int offset, int length)
- Specified by:
add
in interfacegnu.trove.list.TByteList
-
insert
public void insert(int offset, byte value)
- Specified by:
insert
in interfacegnu.trove.list.TByteList
-
insert
public void insert(int offset, byte[] values)
- Specified by:
insert
in interfacegnu.trove.list.TByteList
-
insert
public void insert(int offset, byte[] values, int valOffset, int len)
- Specified by:
insert
in interfacegnu.trove.list.TByteList
-
get
public byte get(int offset)
- Specified by:
get
in interfacegnu.trove.list.TByteList
-
getLinkAt
public gnu.trove.list.linked.TByteLinkedList.TByteLink 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 byte set(int offset, byte val)
- Specified by:
set
in interfacegnu.trove.list.TByteList
-
set
public void set(int offset, byte[] values)
- Specified by:
set
in interfacegnu.trove.list.TByteList
-
set
public void set(int offset, byte[] values, int valOffset, int length)
- Specified by:
set
in interfacegnu.trove.list.TByteList
-
replace
public byte replace(int offset, byte val)
- Specified by:
replace
in interfacegnu.trove.list.TByteList
-
clear
public void clear()
- Specified by:
clear
in interfacegnu.trove.TByteCollection
- Specified by:
clear
in interfacegnu.trove.list.TByteList
-
remove
public boolean remove(byte value)
- Specified by:
remove
in interfacegnu.trove.TByteCollection
- Specified by:
remove
in interfacegnu.trove.list.TByteList
-
containsAll
public boolean containsAll(java.util.Collection<?> collection)
- Specified by:
containsAll
in interfacegnu.trove.TByteCollection
-
containsAll
public boolean containsAll(gnu.trove.TByteCollection collection)
- Specified by:
containsAll
in interfacegnu.trove.TByteCollection
-
containsAll
public boolean containsAll(byte[] array)
- Specified by:
containsAll
in interfacegnu.trove.TByteCollection
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.Byte> collection)
- Specified by:
addAll
in interfacegnu.trove.TByteCollection
-
addAll
public boolean addAll(gnu.trove.TByteCollection collection)
- Specified by:
addAll
in interfacegnu.trove.TByteCollection
-
addAll
public boolean addAll(byte[] array)
- Specified by:
addAll
in interfacegnu.trove.TByteCollection
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
- Specified by:
retainAll
in interfacegnu.trove.TByteCollection
-
retainAll
public boolean retainAll(gnu.trove.TByteCollection collection)
- Specified by:
retainAll
in interfacegnu.trove.TByteCollection
-
retainAll
public boolean retainAll(byte[] array)
- Specified by:
retainAll
in interfacegnu.trove.TByteCollection
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
- Specified by:
removeAll
in interfacegnu.trove.TByteCollection
-
removeAll
public boolean removeAll(gnu.trove.TByteCollection collection)
- Specified by:
removeAll
in interfacegnu.trove.TByteCollection
-
removeAll
public boolean removeAll(byte[] array)
- Specified by:
removeAll
in interfacegnu.trove.TByteCollection
-
removeAt
public byte removeAt(int offset)
- Specified by:
removeAt
in interfacegnu.trove.list.TByteList
-
remove
public void remove(int offset, int length)
- Specified by:
remove
in interfacegnu.trove.list.TByteList
-
transformValues
public void transformValues(gnu.trove.function.TByteFunction function)
- Specified by:
transformValues
in interfacegnu.trove.list.TByteList
-
reverse
public void reverse()
- Specified by:
reverse
in interfacegnu.trove.list.TByteList
-
reverse
public void reverse(int from, int to)
- Specified by:
reverse
in interfacegnu.trove.list.TByteList
-
shuffle
public void shuffle(java.util.Random rand)
- Specified by:
shuffle
in interfacegnu.trove.list.TByteList
-
subList
public gnu.trove.list.TByteList subList(int begin, int end)
- Specified by:
subList
in interfacegnu.trove.list.TByteList
-
toArray
public byte[] toArray()
- Specified by:
toArray
in interfacegnu.trove.TByteCollection
- Specified by:
toArray
in interfacegnu.trove.list.TByteList
-
toArray
public byte[] toArray(int offset, int len)
- Specified by:
toArray
in interfacegnu.trove.list.TByteList
-
toArray
public byte[] toArray(byte[] dest)
- Specified by:
toArray
in interfacegnu.trove.TByteCollection
- Specified by:
toArray
in interfacegnu.trove.list.TByteList
-
toArray
public byte[] toArray(byte[] dest, int offset, int len)
- Specified by:
toArray
in interfacegnu.trove.list.TByteList
-
toArray
public byte[] toArray(byte[] dest, int source_pos, int dest_pos, int len)
- Specified by:
toArray
in interfacegnu.trove.list.TByteList
-
forEach
public boolean forEach(gnu.trove.procedure.TByteProcedure procedure)
- Specified by:
forEach
in interfacegnu.trove.TByteCollection
- Specified by:
forEach
in interfacegnu.trove.list.TByteList
-
forEachDescending
public boolean forEachDescending(gnu.trove.procedure.TByteProcedure procedure)
- Specified by:
forEachDescending
in interfacegnu.trove.list.TByteList
-
sort
public void sort()
- Specified by:
sort
in interfacegnu.trove.list.TByteList
-
sort
public void sort(int fromIndex, int toIndex)
- Specified by:
sort
in interfacegnu.trove.list.TByteList
-
fill
public void fill(byte val)
- Specified by:
fill
in interfacegnu.trove.list.TByteList
-
fill
public void fill(int fromIndex, int toIndex, byte val)
- Specified by:
fill
in interfacegnu.trove.list.TByteList
-
binarySearch
public int binarySearch(byte value)
- Specified by:
binarySearch
in interfacegnu.trove.list.TByteList
-
binarySearch
public int binarySearch(byte value, int fromIndex, int toIndex)
- Specified by:
binarySearch
in interfacegnu.trove.list.TByteList
-
indexOf
public int indexOf(byte value)
- Specified by:
indexOf
in interfacegnu.trove.list.TByteList
-
indexOf
public int indexOf(int offset, byte value)
- Specified by:
indexOf
in interfacegnu.trove.list.TByteList
-
lastIndexOf
public int lastIndexOf(byte value)
- Specified by:
lastIndexOf
in interfacegnu.trove.list.TByteList
-
lastIndexOf
public int lastIndexOf(int offset, byte value)
- Specified by:
lastIndexOf
in interfacegnu.trove.list.TByteList
-
contains
public boolean contains(byte value)
- Specified by:
contains
in interfacegnu.trove.TByteCollection
- Specified by:
contains
in interfacegnu.trove.list.TByteList
-
iterator
public gnu.trove.iterator.TByteIterator iterator()
- Specified by:
iterator
in interfacegnu.trove.TByteCollection
-
grep
public gnu.trove.list.TByteList grep(gnu.trove.procedure.TByteProcedure condition)
- Specified by:
grep
in interfacegnu.trove.list.TByteList
-
inverseGrep
public gnu.trove.list.TByteList inverseGrep(gnu.trove.procedure.TByteProcedure condition)
- Specified by:
inverseGrep
in interfacegnu.trove.list.TByteList
-
max
public byte max()
- Specified by:
max
in interfacegnu.trove.list.TByteList
-
min
public byte min()
- Specified by:
min
in interfacegnu.trove.list.TByteList
-
sum
public byte sum()
- Specified by:
sum
in interfacegnu.trove.list.TByteList
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacegnu.trove.TByteCollection
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacegnu.trove.TByteCollection
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-