Gets the i
-th element of this chunk, throwing an IndexOutOfBoundsException
if the index is not in the range [0,size)
.
Maps and filters this chunk simultaneously using the supplied partial function.
Maps and filters this chunk simultaneously using the supplied partial function.
Copies the elements of this chunk in to the specified array at the specified start index.
Returns a new chunk made up of the elemenets of this chunk without the first n
elements.
Returns a new chunk made up of the elements of this chunk for which the specified predicate returns true.
Reduces this chunk to a value of type B
by applying f
to each element, left to right,
passing the output of each invocation of f
to the next invocation of f
and starting with z
.
Reduces this chunk to a value of type B
by applying f
to each element, right to left,
passing the output of each invocation of f
to the next invocation of f
and starting with z
.
Returns the index of the first element for which p
returns true.
Returns the index of the first element for which p
returns true.
Returns true if this chunk has no elements.
Returns true if this chunk has no elements.
Creates an iterator that iterates the elements of this chunk.
Creates an iterator that iterates the elements of this chunk. The returned iterator is not thread safe.
Applies f
to each element of this chunk, resulting in a new chunk of the same size.
Simultaneously folds and maps this chunk, returning the output of the fold and the transformed chunk.
Simultaneously folds and maps this chunk, returning the output of the fold and the transformed chunk.
Returns true if this chunk has at least 1 element.
Returns true if this chunk has at least 1 element.
Like foldLeft
but each intermediate B
value is output.
Like foldLeft
but each intermediate B
value is output.
Returns the number of elements in this chunk.
Returns a new chunk made up of the first n
elemenets of this chunk.
Copies the elements of this chunk to an array.
Copies the elements of this chunk to an array.
Converts this chunk to a Chunk.Booleans
, allowing access to the underlying array of elements.
Converts this chunk to a Chunk.Booleans
, allowing access to the underlying array of elements.
If this chunk is already backed by an unboxed array of booleans, this method runs in constant time.
Otherwise, this method will copy of the elements of this chunk in to a single array.
Converts this chunk to a Chunk.Bytes
, allowing access to the underlying array of elements.
Converts this chunk to a Chunk.Bytes
, allowing access to the underlying array of elements.
If this chunk is already backed by an unboxed array of booleans, this method runs in constant time.
Otherwise, this method will copy of the elements of this chunk in to a single array.
Converts this chunk to a Chunk.Doubles
, allowing access to the underlying array of elements.
Converts this chunk to a Chunk.Doubles
, allowing access to the underlying array of elements.
If this chunk is already backed by an unboxed array of booleans, this method runs in constant time.
Otherwise, this method will copy of the elements of this chunk in to a single array.
Converts this chunk to a list.
Converts this chunk to a list.
Converts this chunk to a Chunk.Longs
, allowing access to the underlying array of elements.
Converts this chunk to a Chunk.Longs
, allowing access to the underlying array of elements.
If this chunk is already backed by an unboxed array of booleans, this method runs in constant time.
Otherwise, this method will copy of the elements of this chunk in to a single array.
Converts this chunk to a vector.
Converts this chunk to a vector.
If this chunk is non-empty, returns the first element of the chunk and the rest as a new chunk.
If this chunk is non-empty, returns the first element of the chunk and the rest as a new chunk. Otherwise, returns none.
Specialized chunk supporting unboxed operations on bytes.