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