public class TLongArrayList extends Objectimplements TLongList , Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
_data
the data of the list
|
protected int |
_pos
the index after the last entry in the list
|
protected static int |
DEFAULT_CAPACITY
the default capacity for new lists
|
protected long |
no_entry_value
the long value that represents null
|
| Modifier | Constructor and Description |
|---|---|
|
TLongArrayList()
Creates a new
TLongArrayList instance with the default capacity.
|
|
TLongArrayList(int capacity)
Creates a new
TLongArrayList instance with the specified capacity.
|
|
TLongArrayList(int capacity, long no_entry_value)
Creates a new
TLongArrayList instance with the specified capacity.
|
|
TLongArrayList(long[] values)
Creates a new
TLongArrayList instance whose capacity is the length of
values array and whose initial contents are the specified values.
|
protected |
TLongArrayList(long[] values, long no_entry_value, boolean wrap)
|
|
TLongArrayList(TLongCollection
Creates a new
TLongArrayList instance that contains a copy of the collection passed to us.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(long val)
|
void |
add(long[] vals)
|
void |
add(long[] vals, int offset, int length)
|
boolean |
addAll(Collection
|
boolean |
addAll(long[] array)
|
boolean |
addAll(TLongCollection
|
int |
binarySearch(long value)
|
int |
binarySearch(long value, int fromIndex, int toIndex)
|
void |
clear()
|
void |
clear(int capacity)
Flushes the internal state of the list, setting the capacity of the empty list to
capacity.
|
boolean |
contains(long value)
|
boolean |
containsAll(Collection
|
boolean |
containsAll(long[] array)
|
boolean |
containsAll(TLongCollection
|
void |
ensureCapacity(int capacity)
Grow the internal array as needed to accommodate the specified number of elements.
|
boolean |
equals(Object
|
void |
fill(int fromIndex, int toIndex, long val)
|
void |
fill(long val)
|
boolean |
forEach(TLongProcedure
|
boolean |
forEachDescending(TLongProcedure
|
long |
get(int offset)
|
long |
getNoEntryValue()
|
long |
getQuick(int offset)
Returns the value at the specified offset without doing any bounds checking.
|
TLongList |
grep(TLongProcedure
|
int |
hashCode()
|
int |
indexOf(int offset, long value)
|
int |
indexOf(long value)
|
void |
insert(int offset, long value)
|
void |
insert(int offset, long[] values)
|
void |
insert(int offset, long[] values, int valOffset, int len)
|
TLongList |
inverseGrep(TLongProcedure
|
boolean |
isEmpty()
|
TLongIterator |
iterator()
|
int |
lastIndexOf(int offset, long value)
|
int |
lastIndexOf(long value)
|
long |
max()
|
long |
min()
|
void |
readExternal(ObjectInput
|
void |
remove(int offset, int length)
|
boolean |
remove(long value)
|
boolean |
removeAll(Collection
|
boolean |
removeAll(long[] array)
|
boolean |
removeAll(TLongCollection
|
long |
removeAt(int offset)
|
long |
replace(int offset, long val)
|
void |
reset()
Sets the size of the list to 0, but does not change its capacity.
|
void |
resetQuick()
Sets the size of the list to 0, but does not change its capacity.
|
boolean |
retainAll(Collection
|
boolean |
retainAll(long[] array)
|
boolean |
retainAll(TLongCollection
|
void |
reverse()
|
void |
reverse(int from, int to)
|
long |
set(int offset, long val)
|
void |
set(int offset, long[] values)
|
void |
set(int offset, long[] values, int valOffset, int length)
|
void |
setQuick(int offset, long val)
Sets the value at the specified offset without doing any bounds checking.
|
void |
shuffle(Random
|
int |
size()
|
void |
sort()
|
void |
sort(int fromIndex, int toIndex)
|
TLongList |
subList(int begin, int end)
|
long |
sum()
|
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)
|
String |
toString()
|
void |
transformValues(TLongFunction
|
void |
trimToSize()
Sheds any excess capacity above and beyond the current size of the list.
|
static TLongArrayList |
wrap(long[] values)
Returns a primitive List implementation that wraps around the given primitive array.
|
static TLongArrayList |
wrap(long[] values, long no_entry_value)
Returns a primitive List implementation that wraps around the given primitive array.
|
void |
writeExternal(ObjectOutput
|
protected long[] _data
protected int _pos
protected static final int DEFAULT_CAPACITY
protected long no_entry_value
public TLongArrayList()
TLongArrayList instance with the default capacity.
public TLongArrayList(int capacity)
TLongArrayList instance with the specified capacity.
capacity - an
int value
public TLongArrayList(int capacity,
long no_entry_value)
TLongArrayList instance with the specified capacity.
capacity - an
int value
no_entry_value - an
long value that represents null.
public TLongArrayList(TLongCollectioncollection)
TLongArrayList instance that contains a copy of the collection passed to us.
collection - the collection to copy
public TLongArrayList(long[] values)
TLongArrayList instance whose capacity is the length of
values array and whose initial contents are the specified values.
A defensive copy of the given values is held by the new instance.
values - an
long[] value
protected TLongArrayList(long[] values,
long no_entry_value,
boolean wrap)public static TLongArrayListwrap(long[] values)
values -
public static TLongArrayListwrap(long[] values, long no_entry_value)
values -
no_entry_value -
public long getNoEntryValue()
public void ensureCapacity(int capacity)
public int size()
public boolean isEmpty()
public void trimToSize()
public boolean add(long val)
public void add(long[] vals)
public void add(long[] vals,
int offset,
int length)
public void insert(int offset,
long value)
public void insert(int offset,
long[] values)
public void insert(int offset,
long[] values,
int valOffset,
int len)
public long get(int offset)
public long getQuick(int offset)
public long set(int offset,
long val)
public long replace(int offset,
long val)
public void set(int offset,
long[] values)
public void set(int offset,
long[] values,
int valOffset,
int length)
public void setQuick(int offset,
long val)
public void clear()
public void clear(int capacity)
public void reset()
clear() method if you want to recycle a list without allocating new backing arrays.
public void resetQuick()
clear() method if you want to recycle a list without allocating new backing arrays. This method differs from
reset() in that it does not clear the old values in the backing array. Thus, it is possible for getQuick to return stale data if this method is used and the caller is careless about bounds checking.
public boolean remove(long value)
public long removeAt(int offset)
public void remove(int offset,
int length)
public TLongIteratoriterator()
public boolean containsAll(Collection<?> collection)
public boolean containsAll(TLongCollectioncollection)
public boolean containsAll(long[] array)
public boolean addAll(Collection<? extends Long > collection)
public boolean addAll(TLongCollectioncollection)
public boolean addAll(long[] array)
public boolean retainAll(Collection<?> collection)
public boolean retainAll(TLongCollectioncollection)
public boolean retainAll(long[] array)
public boolean removeAll(Collection<?> collection)
public boolean removeAll(TLongCollectioncollection)
public boolean removeAll(long[] array)
public void transformValues(TLongFunctionfunction)
public void reverse()
public void reverse(int from,
int to)
public void shuffle(Randomrand)
public TLongListsubList(int begin, int end)
public long[] toArray()
public long[] toArray(int offset,
int len)
public long[] toArray(long[] dest)
public long[] toArray(long[] dest,
int offset,
int len)
public long[] toArray(long[] dest,
int source_pos,
int dest_pos,
int len)
public boolean equals(Objectother)
public int hashCode()
public boolean forEach(TLongProcedureprocedure)
public boolean forEachDescending(TLongProcedureprocedure)
public void sort()
public void sort(int fromIndex,
int toIndex)
public void fill(long val)
public void fill(int fromIndex,
int toIndex,
long val)
public int binarySearch(long value)
public int binarySearch(long value,
int fromIndex,
int toIndex)
public int indexOf(long value)
public int indexOf(int offset,
long value)
public int lastIndexOf(long value)
public int lastIndexOf(int offset,
long value)
public boolean contains(long value)
public TLongListgrep(TLongProcedure condition)
public TLongListinverseGrep(TLongProcedure condition)
public long max()
public long min()
public long sum()
public StringtoString()
public void writeExternal(ObjectOutputout) throws IOException
writeExternal in interface
Externalizable
IOException
public void readExternal(ObjectInputin) throws IOException , ClassNotFoundException
readExternal in interface
Externalizable
IOException
ClassNotFoundException