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