A Chunk[A]
represents a chunk of values of type A
. Chunks are designed are usually backed by arrays, but expose a purely functional, safe interface to the underlying elements, and they become lazy on operations that would be costly with arrays, such as repeated concatenation.
The implementation of balanced concatenation is based on the one for Conc-Trees in "Conc-Trees for Functional and Parallel Programming" by Aleksandar Prokopec and Martin Odersky. http://aleksandar-prokopec.com/resources/docs/lcpc-conc-trees.pdf
NOTE: For performance reasons Chunk
does not box primitive types. As a result, it is not safe to construct chunks from heterogeneous primitive types.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait ChunkLike[A]trait IndexedSeq[A]trait IndexedSeq[A]trait Seq[A]trait Seq[A]trait Equalstrait Iterable[A]trait Iterable[A]trait IterableOnce[A]class Objecttrait Matchableclass AnyShow all
- Self type
-
Chunk[A]
Members list
Value members
Abstract methods
Concrete methods
Returns the bitwise AND of this chunk and the specified chunk.
Returns the bitwise AND of this chunk and the specified chunk.
Attributes
Returns the concatenation of this chunk with the specified chunk.
Returns the concatenation of this chunk with the specified chunk.
Attributes
Returns the concatenation of this chunk with the specified chunk.
Returns the concatenation of this chunk with the specified chunk.
Attributes
Returns the bitwise XOR of this chunk and the specified chunk.
Returns the bitwise XOR of this chunk and the specified chunk.
Attributes
Crates a base64 encoded string based on the chunk's data.
Crates a base64 encoded string based on the chunk's data.
Attributes
Converts a chunk of bytes to a chunk of bits.
Converts a chunk of bytes to a chunk of bits.
Attributes
Converts a chunk of ints to a chunk of bits.
Converts a chunk of ints to a chunk of bits.
Attributes
Converts a chunk of longs to a chunk of bits.
Converts a chunk of longs to a chunk of bits.
Attributes
Crates a new String based on this chunks data.
Crates a new String based on this chunks data.
Attributes
Crates a new String based on this chunk of bytes and using the given charset.
Crates a new String based on this chunk of bytes and using the given charset.
Attributes
Get the element at the specified index.
Get the element at the specified index.
Attributes
Get the element at the specified index.
Get the element at the specified index.
Attributes
Get the element at the specified index.
Get the element at the specified index.
Attributes
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.
Attributes
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 .
Attributes
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.
Attributes
Deduplicates adjacent elements that are identical.
Deduplicates adjacent elements that are identical.
Attributes
Get the element at the specified index.
Get the element at the specified index.
Attributes
Drops the first n
elements of the chunk.
Drops the first n
elements of the chunk.
Attributes
- Definition Classes
Drops the last n
elements of the chunk.
Drops the last n
elements of the chunk.
Attributes
- Definition Classes
Drops all elements until the predicate returns true.
Drops all elements until the predicate returns true.
Attributes
Drops all elements until the effectful predicate returns true.
Drops all elements until the effectful predicate returns true.
Attributes
Drops all elements so long as the predicate returns true.
Drops all elements so long as the predicate returns true.
Attributes
- Definition Classes
Drops all elements so long as the effectful predicate returns true.
Drops all elements so long as the effectful predicate returns true.
Attributes
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)
).
Value parameters
- that
-
the object to compare against this object for equality.
Attributes
- Returns
-
true
if the receiver object is equivalent to the argument;false
otherwise. - Definition Classes
Determines whether a predicate is satisfied for at least one element of this chunk.
Determines whether a predicate is satisfied for at least one element of this chunk.
Attributes
- Definition Classes
Returns a filtered subset of this chunk.
Returns a filtered subset of this chunk.
Attributes
- Definition Classes
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.
Attributes
Returns the first element that satisfies the predicate.
Returns the first element that satisfies the predicate.
Attributes
- Definition Classes
Returns the first element that satisfies the effectful predicate.
Returns the first element that satisfies the effectful predicate.
Attributes
Get the element at the specified index.
Get the element at the specified index.
Attributes
Folds over the elements in this chunk from the left.
Folds over the elements in this chunk from the right.
Folds over the elements in this chunk from the right.
Attributes
- Definition Classes
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.
Attributes
Effectfully folds over the elements in this chunk from the left.
Effectfully folds over the elements in this chunk from the left.
Attributes
Determines whether a predicate is satisfied for all elements of this chunk.
Determines whether a predicate is satisfied for all elements of this chunk.
Attributes
- Definition Classes
Calculates a hash code value for the object.
Calculates a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
. However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals
method.
Attributes
- Returns
-
the hash code value for this object.
- Definition Classes
-
Seq -> Any
Returns the first element of this chunk. Note that this method is partial in that it will throw an exception if the chunk is empty. Consider using headOption
to explicitly handle the possibility that the chunk is empty or iterating over the elements of the chunk in lower level, performance sensitive code unless you really only need the first element of the chunk.
Returns the first element of this chunk. Note that this method is partial in that it will throw an exception if the chunk is empty. Consider using headOption
to explicitly handle the possibility that the chunk is empty or iterating over the elements of the chunk in lower level, performance sensitive code unless you really only need the first element of the chunk.
Attributes
- Definition Classes
Returns the first element of this chunk if it exists.
Returns the first element of this chunk if it exists.
Attributes
- Definition Classes
Returns the first index for which the given predicate is satisfied after or at some given index.
Returns the first index for which the given predicate is satisfied after or at some given index.
Attributes
- Definition Classes
Get the element at the specified index.
Get the element at the specified index.
Attributes
Determines if the chunk is empty.
Returns the last element of this chunk if it exists.
Get the element at the specified index.
Get the element at the specified index.
Attributes
Statefully maps over the chunk, producing new elements of type B
.
Statefully maps over the chunk, producing new elements of type B
.
Attributes
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.
Attributes
Effectfully maps the elements of this chunk.
Effectfully maps the elements of this chunk.
Attributes
Effectfully maps the elements of this chunk purely for the effects.
Effectfully maps the elements of this chunk purely for the effects.
Attributes
Effectfully maps the elements of this chunk in parallel.
Effectfully maps the elements of this chunk in parallel.
Attributes
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.
Attributes
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.
Attributes
Returns the bitwise NOT of this chunk.
Returns the bitwise NOT of this chunk.
Attributes
Runs fn
if a chunk
is not empty or returns default value
Runs fn
if a chunk
is not empty or returns default value
Attributes
Partitions the elements of this chunk into two chunks using the specified function.
Partitions the elements of this chunk into two chunks using the specified function.
Attributes
- Definition Classes
Get the element at the specified index.
Get the element at the specified index.
Attributes
Attributes
- Definition Classes
Attributes
- Definition Classes
Splits this chunk into n
equally sized chunks.
Splits this chunk into n
equally sized chunks.
Attributes
Returns two splits of this chunk at the specified index.
Returns two splits of this chunk at the specified index.
Attributes
- Definition Classes
Splits this chunk on the first element that matches this predicate.
Splits this chunk on the first element that matches this predicate.
Attributes
Takes the first n
elements of the chunk.
Takes the first n
elements of the chunk.
Attributes
- Definition Classes
Takes the last n
elements of the chunk.
Takes the last n
elements of the chunk.
Attributes
- Definition Classes
Takes all elements so long as the predicate returns true.
Takes all elements so long as the predicate returns true.
Attributes
- Definition Classes
Takes all elements so long as the effectual predicate returns true.
Takes all elements so long as the effectual predicate returns true.
Attributes
Converts the chunk into an array.
Renders this chunk of bits as a binary string.
Renders this chunk of bits as a binary string.
Attributes
Attributes
- Definition Classes
Attributes
- Definition Classes
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.
Attributes
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.
Attributes
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.
Attributes
Zips this chunk with the specified chunk using the specified combiner.
Zips this chunk with the specified chunk using the specified combiner.
Attributes
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.
Attributes
Inherited methods
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- IndexedSeq
Returns a filtered, mapped subset of the elements of this Chunk
.
Returns a filtered, mapped subset of the elements of this Chunk
.
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Returns the concatenation of mapping every element into a new chunk using the specified function.
Returns the concatenation of mapping every element into a new chunk using the specified function.
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
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.
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- Iterable
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- PartialFunction
Returns a chunk with the elements mapped by the specified function.
Returns a chunk with the elements mapped by the specified function.
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
-
IndexedSeq -> SeqOps
- Inherited from:
- IndexedSeq
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IndexedSeq
Attributes
- Inherited from:
- IndexedSeq
Attributes
- Inherited from:
- IndexedSeqOps
Attributes
- Inherited from:
- StrictOptimizedSeqOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Definition Classes
- Inherited from:
- IndexedSeq
Attributes
- Definition Classes
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Attributes
- Definition Classes
- Inherited from:
- IndexedSeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
- Inherited from:
- StrictOptimizedIterableOps
Attributes
- Inherited from:
- IterableOps
Zips this chunk with the index of every element.
Zips this chunk with the index of every element.
Attributes
- Definition Classes
- Inherited from:
- ChunkLike
Deprecated and Inherited methods
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldLeft instead of /: - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use foldRight instead of :\\ - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`. - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use iterableFactory instead - Inherited from:
- IterableOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use `dest ++= coll` instead - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details) - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use segmentLength instead of prefixLength - Inherited from:
- SeqOps
Attributes
- 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
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .reverseIterator.map(f).to(...) instead of .reverseMap(f) - Inherited from:
- SeqOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Iterable.seq always returns the iterable itself - Inherited from:
- Iterable
Attributes
- Deprecated
-
[Since version 2.13.7]
toIterable 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:
- Iterable
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .iterator instead of .toIterator - Inherited from:
- IterableOnceOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .to(LazyList) instead of .toStream - Inherited from:
- IterableOnceOps
Attributes
- 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
Attributes
- Deprecated
-
[Since version 2.13.0]
Use `concat` instead - Inherited from:
- SeqOps
Attributes
- Deprecated
-
[Since version 2.13.0]
Use .view.slice(from, until) instead of .view(from, until) - Definition Classes
- Inherited from:
- IndexedSeqOps
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.
Attributes
- Inherited from:
- ChunkLike