public class WDoubleArrayList extends it.unimi.dsi.fastutil.doubles.DoubleArrayList implements WArrayList<org.apache.hadoop.io.DoubleWritable>, WDoubleCollection
| Modifier and Type | Class and Description |
|---|---|
static class |
WDoubleArrayList.WReusableDoubleArrayList
Variant of WDoubleArrayList that doesn't reallocate smaller backing
array on consecutive readFields/readElements calls, and so is suitable for
reusable use.
|
| Constructor and Description |
|---|
WDoubleArrayList()
Creates a new array list with
DoubleArrayList.DEFAULT_INITIAL_CAPACITY capacity. |
WDoubleArrayList(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
Creates a new array list and fills it with a given type-specific
collection.
|
WDoubleArrayList(it.unimi.dsi.fastutil.doubles.DoubleList l)
Creates a new array list and fills it with a given type-specific list.
|
WDoubleArrayList(int capacity)
Creates a new array list with given capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addW(org.apache.hadoop.io.DoubleWritable value)
Add value to the collection
|
int |
capacity()
Capacity of currently allocated memory
|
void |
fastForEachW(Consumer<org.apache.hadoop.io.DoubleWritable> f)
Traverse all elements of the collection, calling given function on each
element.
|
boolean |
fastForEachWhileW(Predicate<org.apache.hadoop.io.DoubleWritable> f)
Traverse all elements of the collection, calling given function on each
element, or until predicate returns false.
|
ResettableIterator<org.apache.hadoop.io.DoubleWritable> |
fastIteratorW()
Fast iterator over collection objects, which doesn't allocate new
element for each returned element, and can be iterated multiple times
using reset().
|
ResettableIterator<org.apache.hadoop.io.DoubleWritable> |
fastIteratorW(org.apache.hadoop.io.DoubleWritable iterationValue)
Fast iterator over collection objects, which doesn't allocate new
element for each returned element, and can be iterated multiple times
using reset().
|
void |
fillW(int from,
int to,
org.apache.hadoop.io.DoubleWritable value)
Sets given range of elements to a specified value.
|
void |
forEachDouble(DoubleConsumer f)
Traverse all elements of the array list, calling given function on each
element, or until predicate returns false.
|
boolean |
forEachWhileDouble(DoublePredicate f)
Traverse all elements of the array list, calling given function on each
element.
|
PrimitiveTypeOps<org.apache.hadoop.io.DoubleWritable> |
getElementTypeOps()
TypeOps for type of elements this object holds
|
void |
getIntoW(int index,
org.apache.hadoop.io.DoubleWritable to)
Get element at given index in the array, storing it into 'to' argument
|
void |
popIntoW(org.apache.hadoop.io.DoubleWritable to)
Pop value from the end of the array, storing it into 'to' argument
|
void |
readElements(DataInput in,
int size)
Read elements from DataInput stream, with passing the size instead
reading it from the stream.
|
void |
readFields(DataInput in) |
static WDoubleArrayList |
readNew(DataInput in)
Read array list from the DataInput stream into a newly created object.
|
protected void |
resizeArrayForRead(int size)
Resize array for reading given number of elements.
|
void |
setCapacity(int n)
Forces allocated memory to hold exactly N values
|
void |
setW(int index,
org.apache.hadoop.io.DoubleWritable value)
Set element at given index in the array
|
void |
sort()
Sort the array in ascending order
|
void |
write(DataOutput out) |
void |
writeElements(DataOutput out)
Write elements to the DataOutput stream, without the size itself.
|
static void |
writeOrNull(WDoubleArrayList list,
DataOutput out)
Write a potentially null list to a DataOutput.
|
add, add, addAll, addAll, addElements, clear, clone, compareTo, elements, ensureCapacity, equals, getDouble, getElements, indexOf, isEmpty, lastIndexOf, listIterator, rem, removeDouble, removeElements, set, size, size, toDoubleArray, trim, trim, wrap, wrapadd, addAll, addAll, addAll, addAll, addElements, compareTo, contains, doubleListIterator, doubleListIterator, doubleSubList, ensureIndex, ensureRestrictedIndex, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, peek, peekDouble, pop, popDouble, push, push, remove, remove, set, subList, top, topDouble, toStringadd, contains, containsAll, containsAll, doubleIterator, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toDoubleArrayfinalize, getClass, notify, notifyAll, wait, wait, waitsize, trimclear, sizeadd, addAll, contains, containsAll, doubleIterator, iterator, rem, removeAll, retainAll, toArray, toArray, toDoubleArray, toDoubleArrayadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArrayadd, contains, containsAll, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArraypublic WDoubleArrayList()
DoubleArrayList.DEFAULT_INITIAL_CAPACITY capacity.public WDoubleArrayList(int capacity)
capacity - the initial capacity of the array list (may be 0).public WDoubleArrayList(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
c - a type-specific collection that will be used to fill the array
list.public WDoubleArrayList(it.unimi.dsi.fastutil.doubles.DoubleList l)
l - a type-specific list that will be used to fill the array list.public PrimitiveTypeOps<org.apache.hadoop.io.DoubleWritable> getElementTypeOps()
WCollectiongetElementTypeOps in interface WCollection<org.apache.hadoop.io.DoubleWritable>public int capacity()
WCollectioncapacity in interface WCollection<org.apache.hadoop.io.DoubleWritable>public void setCapacity(int n)
WCollectionsetCapacity in interface WCollection<org.apache.hadoop.io.DoubleWritable>n - new capacitypublic void addW(org.apache.hadoop.io.DoubleWritable value)
WCollectionaddW in interface WCollection<org.apache.hadoop.io.DoubleWritable>value - Valuepublic void getIntoW(int index,
org.apache.hadoop.io.DoubleWritable to)
WArrayListgetIntoW in interface WArrayList<org.apache.hadoop.io.DoubleWritable>index - Indexto - Object to store value intopublic void popIntoW(org.apache.hadoop.io.DoubleWritable to)
WArrayListpopIntoW in interface WArrayList<org.apache.hadoop.io.DoubleWritable>to - Object to store value intopublic void setW(int index,
org.apache.hadoop.io.DoubleWritable value)
WArrayListsetW in interface WArrayList<org.apache.hadoop.io.DoubleWritable>index - Indexvalue - Valuepublic void fillW(int from,
int to,
org.apache.hadoop.io.DoubleWritable value)
WArrayListfillW in interface WArrayList<org.apache.hadoop.io.DoubleWritable>from - From index (inclusive)to - To index (exclusive)value - Valuepublic ResettableIterator<org.apache.hadoop.io.DoubleWritable> fastIteratorW()
WCollectionfastIteratorW in interface WCollection<org.apache.hadoop.io.DoubleWritable>public ResettableIterator<org.apache.hadoop.io.DoubleWritable> fastIteratorW(org.apache.hadoop.io.DoubleWritable iterationValue)
WCollectionfastIteratorW in interface WCollection<org.apache.hadoop.io.DoubleWritable>iterationValue - Value that call to next() will populatepublic void fastForEachW(Consumer<org.apache.hadoop.io.DoubleWritable> f)
WCollectionfastForEachW in interface WCollection<org.apache.hadoop.io.DoubleWritable>f - Function to call on each element.public boolean fastForEachWhileW(Predicate<org.apache.hadoop.io.DoubleWritable> f)
WCollectionfastForEachWhileW in interface WCollection<org.apache.hadoop.io.DoubleWritable>f - Function to call on each element.public void forEachDouble(DoubleConsumer f)
forEachDouble in interface WDoubleCollectionf - Function to call on each element.public boolean forEachWhileDouble(DoublePredicate f)
forEachWhileDouble in interface WDoubleCollectionf - Function to call on each element.public void sort()
WArrayListsort in interface WArrayList<org.apache.hadoop.io.DoubleWritable>public void writeElements(DataOutput out) throws IOException
WCollectionwriteElements in interface WCollection<org.apache.hadoop.io.DoubleWritable>out - Data outputIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readElements(DataInput in, int size) throws IOException
WCollectionreadElements in interface WCollection<org.apache.hadoop.io.DoubleWritable>in - Data Inputsize - Number of elementsIOExceptionprotected void resizeArrayForRead(int size)
size - Number of elements that will be read.public void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic static void writeOrNull(WDoubleArrayList list, DataOutput out) throws IOException
list - Array list to be writtenout - Data outputIOExceptionpublic static WDoubleArrayList readNew(DataInput in) throws IOException
in - Data inputIOExceptionCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.