public static interface Node.OfInt extends Node.OfPrimitive<Integer,IntConsumer,int[],Spliterator.OfInt,Node.OfInt>
Node
for int elementsNode.Builder<T>, Node.OfDouble, Node.OfInt, Node.OfLong, Node.OfPrimitive<T,T_CONS,T_ARR,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>,T_NODE extends Node.OfPrimitive<T,T_CONS,T_ARR,T_SPLITR,T_NODE>>
Modifier and Type | Method and Description |
---|---|
default void |
copyInto(Integer[] boxed,
int offset)
Copies the content of this
Node into an array, starting at a
given offset into the array. |
default void |
forEach(Consumer<? super Integer> consumer)
Traverses the elements of this node, and invoke the provided
Consumer with each element. |
default StreamShape |
getShape()
Gets the
StreamShape associated with this Node . |
default int[] |
newArray(int count)
Creates a new primitive array.
|
default Node.OfInt |
truncate(long from,
long to,
IntFunction<Integer[]> generator)
Return a node describing a subsequence of the elements of this node,
starting at the given inclusive start offset and ending at the given
exclusive end offset.
|
asArray, asPrimitiveArray, copyInto, forEach, getChild, spliterator
count, getChildCount
default void forEach(Consumer<? super Integer> consumer)
Consumer
with each element. Elements are provided in encounter
order if the source for the Node
has a defined encounter order.default void copyInto(Integer[] boxed, int offset)
Node
into an array, starting at a
given offset into the array. It is the caller's responsibility to ensure
there is sufficient room in the array, otherwise unspecified behaviour
will occur if the array length is less than the number of elements
contained in this node.default Node.OfInt truncate(long from, long to, IntFunction<Integer[]> generator)
Node
truncate
in interface Node<Integer>
truncate
in interface Node.OfPrimitive<Integer,IntConsumer,int[],Spliterator.OfInt,Node.OfInt>
from
- The (inclusive) starting offset of elements to include, must
be in range 0..count().to
- The (exclusive) end offset of elements to include, must be
in range 0..count().generator
- A function to be used to create a new array, if needed,
for reference nodes.default int[] newArray(int count)
Node.OfPrimitive
newArray
in interface Node.OfPrimitive<Integer,IntConsumer,int[],Spliterator.OfInt,Node.OfInt>
count
- the length of the primitive array.default StreamShape getShape()
StreamShape
associated with this Node
.