A NonEmptyChunk
is a Chunk
that is guaranteed to contain at least one
element. As a result, operations which would not be safe when performed on
Chunk
, such as head
or reduce
, are safe when performed on
NonEmptyChunk
. Operations on NonEmptyChunk
which could potentially return
an empty chunk will return a Chunk
instead.
- Companion:
- object
Value members
Concrete methods
Returns the concatenation of this chunk with the specified chunk.
Returns the concatenation of this chunk with the specified chunk.
Appends the specified Chunk
to the end of this NonEmptyChunk
.
Appends the specified Chunk
to the end of this NonEmptyChunk
.
Appends a single element to the end of this NonEmptyChunk
.
Appends a single element to the end of this NonEmptyChunk
.
Converts a chunk of bytes to a chunk of bits.
Converts a chunk of bytes to a chunk of bits.
Converts this NonEmptyChunk
of bytes to a NonEmptyChunk
of bits.
Converts this NonEmptyChunk
of bytes to a NonEmptyChunk
of bits.
Get the element at the specified index.
Get the element at the specified index.
Get the element at the specified index.
Get the element at the specified index.
Get the element at the specified index.
Get the element at the specified index.
Returns a filtered, mapped subset of the elements of this chunk based on a .
Returns a filtered, mapped subset of the elements of this chunk based on a .
Transforms all elements of the chunk for as long as the specified partial function is defined.
Transforms all elements of the chunk for as long as the specified partial function is defined.
Determines whether this chunk and the specified chunk have the same length and every pair of corresponding elements of this chunk and the specified chunk satisfy the specified predicate.
Determines whether this chunk and the specified chunk have the same length and every pair of corresponding elements of this chunk and the specified chunk satisfy the specified predicate.
Get the element at the specified index.
Get the element at the specified index.
Returns whether this NonEmptyChunk
and the specified NonEmptyChunk
are
equal to each other.
Returns whether this NonEmptyChunk
and the specified NonEmptyChunk
are
equal to each other.
- Definition Classes
- Any
Filters this chunk by the specified effectful predicate, retaining all elements for which the predicate evaluates to true.
Filters this chunk by the specified effectful predicate, retaining all elements for which the predicate evaluates to true.
Maps each element of this NonEmptyChunk
to a new NonEmptyChunk
and then
concatenates them together.
Maps each element of this NonEmptyChunk
to a new NonEmptyChunk
and then
concatenates them together.
Flattens a chunk of chunks into a single chunk by concatenating all chunks.
Flattens a chunk of chunks into a single chunk by concatenating all chunks.
Flattens a NonEmptyChunk
of NonEmptyChunk
values to a single
NonEmptyChunk
.
Flattens a NonEmptyChunk
of NonEmptyChunk
values to a single
NonEmptyChunk
.
Get the element at the specified index.
Get the element at the specified index.
Effectfully folds over the elements in this chunk from the left.
Effectfully folds over the elements in this chunk from the left.
Folds over the elements in this chunk from the left. Stops the fold early when the condition is not fulfilled.
Folds over the elements in this chunk from the left. Stops the fold early when the condition is not fulfilled.
Returns the hashcode of this NonEmptyChunk
.
Returns the hashcode of this NonEmptyChunk
.
- Definition Classes
- Any
Get the element at the specified index.
Get the element at the specified index.
Get the element at the specified index.
Get the element at the specified index.
Transforms the elements of this NonEmptyChunk
with the specified
function.
Transforms the elements of this NonEmptyChunk
with the specified
function.
Statefully maps over the chunk, producing new elements of type B
.
Statefully maps over the chunk, producing new elements of type B
.
Maps over the elements of this NonEmptyChunk
, maintaining some state
along the way.
Maps over the elements of this NonEmptyChunk
, maintaining some state
along the way.
Statefully and effectfully maps over the elements of this chunk to produce new elements.
Statefully and effectfully maps over the elements of this chunk to produce new elements.
Effectfully maps over the elements of this NonEmptyChunk
, maintaining
some state along the way.
Effectfully maps over the elements of this NonEmptyChunk
, maintaining
some state along the way.
Effectfully maps the elements of this chunk.
Effectfully maps the elements of this chunk.
Effectfully maps the elements of this NonEmptyChunk
.
Effectfully maps the elements of this NonEmptyChunk
.
Effectfully maps the elements of this chunk in parallel.
Effectfully maps the elements of this chunk in parallel.
Effectfully maps the elements of this NonEmptyChunk
in parallel.
Effectfully maps the elements of this NonEmptyChunk
in parallel.
Effectfully maps the elements of this chunk in parallel purely for the effects.
Effectfully maps the elements of this chunk in parallel purely for the effects.
Effectfully maps the elements of this chunk purely for the effects.
Effectfully maps the elements of this chunk purely for the effects.
Materializes a chunk into a chunk backed by an array. This method can improve the performance of bulk operations.
Materializes a chunk into a chunk backed by an array. This method can improve the performance of bulk operations.
Materialize the elements of this NonEmptyChunk
into a NonEmptyChunk
backed by an array.
Materialize the elements of this NonEmptyChunk
into a NonEmptyChunk
backed by an array.
Runs fn
if a chunk
is not empty or returns default value
Runs fn
if a chunk
is not empty or returns default value
Prepends the specified Chunk
to the beginning of this NonEmptyChunk
.
Prepends the specified Chunk
to the beginning of this NonEmptyChunk
.
Prepends a single element to the beginning of this NonEmptyChunk
.
Prepends a single element to the beginning of this NonEmptyChunk
.
Reduces the elements of this NonEmptyChunk
from left to right using the
function map
to transform the first value to the type B
and then the
function reduce
to combine the B
value with each other A
value.
Reduces the elements of this NonEmptyChunk
from left to right using the
function map
to transform the first value to the type B
and then the
function reduce
to combine the B
value with each other A
value.
Reduces the elements of this NonEmptyChunk
from right to left using the
function map
to transform the first value to the type B
and then the
function reduce
to combine the B
value with each other A
value.
Reduces the elements of this NonEmptyChunk
from right to left using the
function map
to transform the first value to the type B
and then the
function reduce
to combine the B
value with each other A
value.
Get the element at the specified index.
Get the element at the specified index.
Splits this chunk into n
equally sized chunks.
Splits this chunk into n
equally sized chunks.
Splits this chunk on the first element that matches this predicate.
Splits this chunk on the first element that matches this predicate.
Takes all elements so long as the effectual predicate returns true.
Takes all elements so long as the effectual predicate returns true.
Renders this chunk of bits as a binary string.
Renders this chunk of bits as a binary string.
Converts this NonEmptyChunk
to a Chunk
, discarding information about it
not being empty.
Converts this NonEmptyChunk
to a Chunk
, discarding information about it
not being empty.
Converts this NonEmptyChunk
to the ::
case of a List
.
Converts this NonEmptyChunk
to the ::
case of a List
.
Renders this NonEmptyChunk
as a String
.
Renders this NonEmptyChunk
as a String
.
- Definition Classes
- Any
Zips this chunk with the specified chunk to produce a new chunk with pairs of elements from each chunk. The returned chunk will have the length of the shorter chunk.
Zips this chunk with the specified chunk to produce a new chunk with pairs of elements from each chunk. The returned chunk will have the length of the shorter chunk.
Zips this NonEmptyChunk
with the specified NonEmptyChunk
, only keeping
as many elements as are in the smaller chunk.
Zips this NonEmptyChunk
with the specified NonEmptyChunk
, only keeping
as many elements as are in the smaller chunk.
Zips this chunk with the specified chunk to produce a new chunk with pairs
of elements from each chunk, filling in missing values from the shorter
chunk with None
. The returned chunk will have the length of the longer
chunk.
Zips this chunk with the specified chunk to produce a new chunk with pairs
of elements from each chunk, filling in missing values from the shorter
chunk with None
. The returned chunk will have the length of the longer
chunk.
Zips this NonEmptyChunk
with the specified Chunk
, using None
to "fill
in" missing values if one chunk has fewer elements than the other.
Zips this NonEmptyChunk
with the specified Chunk
, using None
to "fill
in" missing values if one chunk has fewer elements than the other.
Zips with chunk with the specified chunk to produce a new chunk with pairs
of elements from each chunk combined using the specified function both
.
If one chunk is shorter than the other uses the specified function left
or right
to map the element that does exist to the result type.
Zips with chunk with the specified chunk to produce a new chunk with pairs
of elements from each chunk combined using the specified function both
.
If one chunk is shorter than the other uses the specified function left
or right
to map the element that does exist to the result type.
Zips this NonEmptyChunk
with the specified Chunk
, using the specified
functions to "fill in" missing values if one chunk has fewer elements than
the other.
Zips this NonEmptyChunk
with the specified Chunk
, using the specified
functions to "fill in" missing values if one chunk has fewer elements than
the other.
Zips this chunk with the specified chunk using the specified combiner.
Zips this chunk with the specified chunk using the specified combiner.
Zips this NonEmptyChunk
with the specified NonEmptyChunk
, only keeping
as many elements as are in the smaller chunk.
Zips this NonEmptyChunk
with the specified NonEmptyChunk
, only keeping
as many elements as are in the smaller chunk.
Annotates each element of this NonEmptyChunk
with its index.
Annotates each element of this NonEmptyChunk
with its index.
Zips this chunk with the index of every element, starting from the initial index value.
Zips this chunk with the index of every element, starting from the initial index value.
Deprecated methods
Appends an element to the chunk
Appends an element to the chunk
- Deprecated
Inherited methods
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
- Inherited from:
- IterableOnceOps
- Inherited from:
- IndexedSeq
- Inherited from:
- StrictOptimizedSeqOps
- Inherited from:
- IterableOnceOps
Deprecated and Inherited methods
- Deprecated
[Since version 2.13.0]
Use foldLeft instead of /:- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use foldRight instead of :\\- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
`aggregate` is not relevant for sequential collections. Use `foldLeft(z)(seqop)` instead.- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use iterableFactory instead- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]
Use `dest ++= coll` instead- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use coll instead of repr in a collection implementation, use the collection value itself from the outside- Inherited from:
- IterableOps
- Deprecated
[Since version 2.13.0]
Use .iterator instead of .toIterator- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream- Inherited from:
- IterableOnceOps
- Deprecated
[Since version 2.13.0]
toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections- Inherited from:
- IterableOps
Inherited fields
Returns a SeqFactory
that can construct Chunk
values. The SeqFactory
exposes a newBuilder
method that is not referentially transparent because
it allocates mutable state.
Returns a SeqFactory
that can construct Chunk
values. The SeqFactory
exposes a newBuilder
method that is not referentially transparent because
it allocates mutable state.
- Inherited from:
- ChunkLike