An immutable, efficient sequence of elements.
Chunk provides O(1) operations for many common operations like take, drop, and slice. It also provides efficient concatenation and element access.
Type parameters
- A
-
the type of elements in this Chunk
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Seq[A]trait SeqOps[A, Seq, Seq[A]]trait Seq[A]trait Equalstrait SeqOps[A, Seq, Seq[A]]trait PartialFunction[Int, A]trait Int => Atrait Iterable[A]trait Iterable[A]trait IterableFactoryDefaults[A, Seq]trait IterableOps[A, Seq, Seq[A]]trait IterableOnceOps[A, Seq, Seq[A]]trait IterableOnce[A]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class Indexed[A]
- Self type
-
Chunk[A]
Members list
Value members
Concrete methods
Appends an element to the end of the Chunk.
Appends an element to the end of the Chunk.
Value parameters
- v
-
the element to append
Attributes
- Returns
-
a new Chunk with the element appended
Returns the element at the specified index.
Returns the element at the specified index.
Value parameters
- index
-
the index of the element to return
Attributes
- Returns
-
the element at the specified index
- Throws
-
IndexOutOfBoundsException
if the index is out of bounds
Returns a new Chunk containing only the elements that change from the previous element.
Returns a new Chunk containing only the elements that change from the previous element.
Value parameters
- using
-
CanEqual[A, A] implicit evidence that A can be compared for equality
Attributes
- Returns
-
a new Chunk containing only the changing elements
Returns a new Chunk containing only the elements that change from the previous element, with a given initial value.
Returns a new Chunk containing only the elements that change from the previous element, with a given initial value.
Value parameters
- first
-
the initial value to compare against
- using
-
CanEqual[A, A] implicit evidence that A can be compared for equality
Attributes
- Returns
-
a new Chunk containing only the changing elements
Concatenates this Chunk with another Chunk.
Concatenates this Chunk with another Chunk.
Value parameters
- other
-
the Chunk to concatenate with this one
Attributes
- Returns
-
a new Chunk containing all elements from this Chunk followed by all elements from the other Chunk
Copies the elements of this Chunk to an array.
Copies the elements of this Chunk to an array.
Value parameters
- array
-
the array to copy to
- start
-
the starting position in the array
Attributes
Copies a specified number of elements from this Chunk to an array.
Copies a specified number of elements from this Chunk to an array.
Value parameters
- array
-
the array to copy to
- elements
-
the number of elements to copy
- start
-
the starting position in the array
Attributes
Drops the first n elements of the Chunk.
Drops the first n elements of the Chunk.
Value parameters
- n
-
the number of elements to drop
Attributes
- Returns
-
a new Chunk with the first n elements removed
- Definition Classes
-
IterableOps -> IterableOnceOps
Drops the first n elements of the Chunk.
Drops the first n elements of the Chunk.
Value parameters
- n
-
the number of elements to drop
Attributes
- Returns
-
a new Chunk with the first n elements removed
Drops elements from both ends of the Chunk.
Drops elements from both ends of the Chunk.
Value parameters
- left
-
the number of elements to drop from the left
- right
-
the number of elements to drop from the right
Attributes
- Returns
-
a new Chunk with elements dropped from both ends
Drops the last n elements of the Chunk.
Drops the last n elements of the Chunk.
Value parameters
- n
-
the number of elements to drop
Attributes
- Returns
-
a new Chunk with the last n elements removed
- Definition Classes
-
IterableOps
Flattens a Chunk of Chunks into a single Chunk.
Flattens a Chunk of Chunks into a single Chunk.
Value parameters
- ev
-
evidence that A is a Chunk[B]
Attributes
- Returns
-
a flattened Chunk
Checks if the Chunk is empty.
Checks if the Chunk is empty.
Attributes
- Returns
-
true if the Chunk contains no elements, false otherwise
- Definition Classes
-
SeqOps -> IterableOnceOps
Returns an iterator over the elements of the Chunk.
Returns an iterator over the elements of the Chunk.
Attributes
- Returns
-
an Iterator[A] over the elements of the Chunk
Returns the last element of the Chunk.
Returns the last element of the Chunk.
Attributes
- Returns
-
the last element
- Throws
-
NoSuchElementException
if the Chunk is empty
- Definition Classes
-
IterableOps
Returns a Chunk that is a slice of this Chunk.
Returns a Chunk that is a slice of this Chunk.
Value parameters
- from
-
the starting index of the slice
- until
-
the ending index (exclusive) of the slice
Attributes
- Returns
-
a new Chunk containing the specified slice
- Definition Classes
-
IterableOps -> IterableOnceOps
Takes the first n elements of the Chunk.
Takes the first n elements of the Chunk.
Value parameters
- n
-
the number of elements to take
Attributes
- Returns
-
a new Chunk containing the first n elements
- Definition Classes
-
IterableOps -> IterableOnceOps
Converts this Chunk to an Array.
Converts this Chunk to an Array.
Attributes
- Returns
-
an Array containing all elements of this Chunk
- Definition Classes
-
IterableOnceOps
Inherited methods
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
SeqOps -> IterableOps
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
-
PartialFunction -> Function1
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- Function1
Attributes
- Definition Classes
-
SeqOps -> IterableOps
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Definition Classes
-
IterableFactoryDefaults -> IterableOps
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- SeqOps
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
xof typeAny,x.equals(x)should returntrue. - It is symmetric: for any instances
xandyof typeAny,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any instances
x,y, andzof typeAnyifx.equals(y)returnstrueandy.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
-
trueif the receiver object is equivalent to the argument;falseotherwise. - Definition Classes
-
Seq -> Equals -> Any
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
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:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
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
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
-
IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
Seq -> Seq -> Iterable -> Iterable -> IterableOps
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- Iterable
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- IterableOps
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:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableFactoryDefaults
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
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:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
-
SeqOps -> IterableOnceOps
- Inherited from:
- SeqOps
Attributes
- Definition Classes
-
SeqOps -> IterableOps
- Inherited from:
- SeqOps
Attributes
- Definition Classes
-
SeqOps -> IterableOps
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOnce
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Definition Classes
-
IterableOps -> IterableOnceOps
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Definition Classes
-
Seq -> IterableOnceOps
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOnceOps
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Seq -> Function1 -> Iterable -> Any
- Inherited from:
- Seq
Attributes
- Inherited from:
- IterableOnceOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- PartialFunction
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- SeqOps
Attributes
- Definition Classes
-
SeqOps -> IterableOps
- Inherited from:
- SeqOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Attributes
- Inherited from:
- IterableOps
Inherited and Abstract methods
Attributes
- Inherited from:
- SeqOps
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) - Inherited from:
- IterableOps