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