T
- Element typepublic interface WCollection<T>
extends org.apache.hadoop.io.Writable
Modifier and Type | Method and Description |
---|---|
void |
addW(T value)
Add value to the collection
|
int |
capacity()
Capacity of currently allocated memory
|
void |
clear()
Removes all of the elements from this
|
void |
fastForEachW(Consumer<T> f)
Traverse all elements of the collection, calling given function on each
element.
|
boolean |
fastForEachWhileW(Predicate<T> f)
Traverse all elements of the collection, calling given function on each
element, or until predicate returns false.
|
ResettableIterator<T> |
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<T> |
fastIteratorW(T iterationValue)
Fast iterator over collection objects, which doesn't allocate new
element for each returned element, and can be iterated multiple times
using reset().
|
PrimitiveTypeOps<T> |
getElementTypeOps()
TypeOps for type of elements this object holds
|
void |
readElements(DataInput in,
int size)
Read elements from DataInput stream, with passing the size instead
reading it from the stream.
|
void |
setCapacity(int n)
Forces allocated memory to hold exactly N values
|
int |
size()
Number of elements in this list
|
void |
writeElements(DataOutput out)
Write elements to the DataOutput stream, without the size itself.
|
void clear()
int size()
int capacity()
void setCapacity(int n)
n
- new capacityvoid addW(T value)
value
- ValuePrimitiveTypeOps<T> getElementTypeOps()
ResettableIterator<T> fastIteratorW()
ResettableIterator<T> fastIteratorW(T iterationValue)
iterationValue
- Value that call to next() will populatevoid fastForEachW(Consumer<T> f)
f
- Function to call on each element.boolean fastForEachWhileW(Predicate<T> f)
f
- Function to call on each element.void writeElements(DataOutput out) throws IOException
out
- Data outputIOException
void readElements(DataInput in, int size) throws IOException
in
- Data Inputsize
- Number of elementsIOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.