public class TIntArrayList extends Objectimplements TIntList , Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
_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 int |
no_entry_value
the int value that represents null
|
| Modifier | Constructor and Description |
|---|---|
|
TIntArrayList()
Creates a new
TIntArrayList instance with the default capacity.
|
|
TIntArrayList(int capacity)
Creates a new
TIntArrayList instance with the specified capacity.
|
|
TIntArrayList(int[] values)
Creates a new
TIntArrayList instance whose capacity is the length of
values array and whose initial contents are the specified values.
|
protected |
TIntArrayList(int[] values, int no_entry_value, boolean wrap)
|
|
TIntArrayList(int capacity, int no_entry_value)
Creates a new
TIntArrayList instance with the specified capacity.
|
|
TIntArrayList(TIntCollection
Creates a new
TIntArrayList instance that contains a copy of the collection passed to us.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int val)
|
void |
add(int[] vals)
|
void |
add(int[] vals, int offset, int length)
|
boolean |
addAll(Collection
|
boolean |
addAll(int[] array)
|
boolean |
addAll(TIntCollection
|
int |
binarySearch(int value)
|
int |
binarySearch(int 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(int value)
|
boolean |
containsAll(Collection
|
boolean |
containsAll(int[] array)
|
boolean |
containsAll(TIntCollection
|
void |
ensureCapacity(int capacity)
Grow the internal array as needed to accommodate the specified number of elements.
|
boolean |
equals(Object
|
void |
fill(int val)
|
void |
fill(int fromIndex, int toIndex, int val)
|
boolean |
forEach(TIntProcedure
|
boolean |
forEachDescending(TIntProcedure
|
int |
get(int offset)
|
int |
getNoEntryValue()
|
int |
getQuick(int offset)
Returns the value at the specified offset without doing any bounds checking.
|
TIntList |
grep(TIntProcedure
|
int |
hashCode()
|
int |
indexOf(int value)
|
int |
indexOf(int offset, int value)
|
void |
insert(int offset, int value)
|
void |
insert(int offset, int[] values)
|
void |
insert(int offset, int[] values, int valOffset, int len)
|
TIntList |
inverseGrep(TIntProcedure
|
boolean |
isEmpty()
|
TIntIterator |
iterator()
|
int |
lastIndexOf(int value)
|
int |
lastIndexOf(int offset, int value)
|
int |
max()
|
int |
min()
|
void |
readExternal(ObjectInput
|
boolean |
remove(int value)
|
void |
remove(int offset, int length)
|
boolean |
removeAll(Collection
|
boolean |
removeAll(int[] array)
|
boolean |
removeAll(TIntCollection
|
int |
removeAt(int offset)
|
int |
replace(int offset, int 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(int[] array)
|
boolean |
retainAll(TIntCollection
|
void |
reverse()
|
void |
reverse(int from, int to)
|
int |
set(int offset, int val)
|
void |
set(int offset, int[] values)
|
void |
set(int offset, int[] values, int valOffset, int length)
|
void |
setQuick(int offset, int 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)
|
TIntList |
subList(int begin, int end)
|
int |
sum()
|
int[] |
toArray()
|
int[] |
toArray(int[] dest)
|
int[] |
toArray(int[] dest, int offset, int len)
|
int[] |
toArray(int[] dest, int source_pos, int dest_pos, int len)
|
int[] |
toArray(int offset, int len)
|
String |
toString()
|
void |
transformValues(TIntFunction
|
void |
trimToSize()
Sheds any excess capacity above and beyond the current size of the list.
|
static TIntArrayList |
wrap(int[] values)
Returns a primitive List implementation that wraps around the given primitive array.
|
static TIntArrayList |
wrap(int[] values, int no_entry_value)
Returns a primitive List implementation that wraps around the given primitive array.
|
void |
writeExternal(ObjectOutput
|
protected int[] _data
protected int _pos
protected static final int DEFAULT_CAPACITY
protected int no_entry_value
public TIntArrayList()
TIntArrayList instance with the default capacity.
public TIntArrayList(int capacity)
TIntArrayList instance with the specified capacity.
capacity - an
int value
public TIntArrayList(int capacity,
int no_entry_value)
TIntArrayList instance with the specified capacity.
capacity - an
int value
no_entry_value - an
int value that represents null.
public TIntArrayList(TIntCollectioncollection)
TIntArrayList instance that contains a copy of the collection passed to us.
collection - the collection to copy
public TIntArrayList(int[] values)
TIntArrayList 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
int[] value
protected TIntArrayList(int[] values,
int no_entry_value,
boolean wrap)public static TIntArrayListwrap(int[] values)
values -
public static TIntArrayListwrap(int[] values, int no_entry_value)
values -
no_entry_value -
public int getNoEntryValue()
public void ensureCapacity(int capacity)
public int size()
public boolean isEmpty()
public void trimToSize()
public boolean add(int val)
public void add(int[] vals)
public void add(int[] vals,
int offset,
int length)
public void insert(int offset,
int value)
public void insert(int offset,
int[] values)
public void insert(int offset,
int[] values,
int valOffset,
int len)
public int get(int offset)
public int getQuick(int offset)
public int set(int offset,
int val)
public int replace(int offset,
int val)
public void set(int offset,
int[] values)
public void set(int offset,
int[] values,
int valOffset,
int length)
public void setQuick(int offset,
int 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(int value)
public int removeAt(int offset)
public void remove(int offset,
int length)
public TIntIteratoriterator()
public boolean containsAll(Collection<?> collection)
public boolean containsAll(TIntCollectioncollection)
public boolean containsAll(int[] array)
public boolean addAll(Collection<? extends Integer > collection)
public boolean addAll(TIntCollectioncollection)
public boolean addAll(int[] array)
public boolean retainAll(Collection<?> collection)
public boolean retainAll(TIntCollectioncollection)
public boolean retainAll(int[] array)
public boolean removeAll(Collection<?> collection)
public boolean removeAll(TIntCollectioncollection)
public boolean removeAll(int[] array)
public void transformValues(TIntFunctionfunction)
public void reverse()
public void reverse(int from,
int to)
public void shuffle(Randomrand)
public TIntListsubList(int begin, int end)
public int[] toArray()
public int[] toArray(int offset,
int len)
public int[] toArray(int[] dest)
public int[] toArray(int[] dest,
int offset,
int len)
public int[] toArray(int[] dest,
int source_pos,
int dest_pos,
int len)
public boolean equals(Objectother)
public int hashCode()
public boolean forEach(TIntProcedureprocedure)
public boolean forEachDescending(TIntProcedureprocedure)
public void sort()
public void sort(int fromIndex,
int toIndex)
public void fill(int val)
public void fill(int fromIndex,
int toIndex,
int val)
public int binarySearch(int value)
public int binarySearch(int value,
int fromIndex,
int toIndex)
public int indexOf(int value)
public int indexOf(int offset,
int value)
public int lastIndexOf(int value)
public int lastIndexOf(int offset,
int value)
public boolean contains(int value)
public TIntListgrep(TIntProcedure condition)
public TIntListinverseGrep(TIntProcedure condition)
public int max()
public int min()
public int 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