Lazy and immutable slice of a sequence of values.
Type parameters
- T
-
type of the items of the sequence.
Attributes
- Note
-
As the slice usually wraps over a mutable structure, like an array or a java buffer, and it DOES NOT make an instant copy, any changes to the underlying source will directly affect the slice output unless detached. Detach is a one-time copy operation, and
detached
property is preserved across all operations returning a Slice. - Companion
- object
- Graph
-
- Supertypes
-
trait Int => Tclass Objecttrait Matchableclass Any
- Known subtypes
-
trait ArraySliceLike[T]class ArraySlice[T]class ByteSliceclass IntSliceclass LazyMapArraySlice[T]class RangeMapSlice[T]Show all
Members list
Value members
Abstract methods
Returns a trimmed copy of an underlying array.
Returns a trimmed copy of an underlying array.
Attributes
Returns a buffer with a copy of this Slice.
Returns a buffer with a copy of this Slice.
Attributes
Detaches a slice creating a trimmed copy of an underlying data, if needed. Subsequent detach operations will return the same instance without making new copies.
Detaches a slice creating a trimmed copy of an underlying data, if needed. Subsequent detach operations will return the same instance without making new copies.
Attributes
Lazily composes mapping function and returns new Slice. Does not modify nor copy underlying array.
Lazily composes mapping function and returns new Slice. Does not modify nor copy underlying array.
Attributes
Lazily narrows Slice to provided range.
Lazily narrows Slice to provided range.
Attributes
Returns a buffer with a copy of this Slice.
Returns a buffer with a copy of this Slice.
Attributes
Concrete methods
Returns value at the given index.
Returns value at the given index.
Attributes
- Definition Classes
-
Function1
Returns new iterable of Slice values.
Returns new iterable of Slice values.
Attributes
Dumps content to the array, starting from an index.
Dumps content to the array, starting from an index.
Attributes
Counts values fulfilling the predicate.
Counts values fulfilling the predicate.
Attributes
Lazily narrows Slice to exclude first N items.
Lazily narrows Slice to exclude first N items.
Attributes
Lazily narrows Slice to exclude last N items.
Lazily narrows Slice to exclude last N items.
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
-
Any
Returns true if any value fulfills the predicate, or false.
Returns true if any value fulfills the predicate, or false.
Attributes
Returns Some of the first value fulfilling the predicate, or None.
Returns Some of the first value fulfilling the predicate, or None.
Attributes
Combines from left to right all elements, starting with initial.
Combines from left to right all elements, starting with initial.
Attributes
Folds from left to right all elements, starting with initial.
Folds from left to right all elements, starting with initial.
Attributes
Folds from right to left all elements, starting with initial.
Folds from right to left all elements, starting with initial.
Attributes
Returns Some of the value at the index, or None if index outside of range.
Returns Some of the value at the index, or None if index outside of range.
Attributes
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
-
Any
Returns first value in the Slice.
Returns first value in the Slice.
Attributes
Returns first value in the Slice.
Returns first value in the Slice.
Attributes
Returns iterator over Slice indexes of values fulfilling the predicate.
Returns iterator over Slice indexes of values fulfilling the predicate.
Attributes
Returns the Slice without last value.
Returns the Slice without last value.
Attributes
Returns true if Slice has values, otherwise false.
Returns true if Slice has values, otherwise false.
Attributes
Returns iterator over Slice values.
Returns iterator over Slice values.
Attributes
Returns iterator over Slice values fulfilling the predicate.
Returns iterator over Slice values fulfilling the predicate.
Attributes
Returns the last value in the Slice.
Returns the last value in the Slice.
Attributes
Returns the last value in the Slice.
Returns the last value in the Slice.
Attributes
Returns true if Slice has values, otherwise false.
Returns true if Slice has values, otherwise false.
Attributes
Combines from right to left all elements.
Combines from right to left all elements.
Attributes
Returns iterator over Slice indexes of values fulfilling the predicate, in the reverse order.
Returns iterator over Slice indexes of values fulfilling the predicate, in the reverse order.
Attributes
Returns iterator over Slice values in the reverse order.
Returns iterator over Slice values in the reverse order.
Attributes
Returns iterator over Slice values fulfilling the predicate, in the reverse order.
Returns iterator over Slice values fulfilling the predicate, in the reverse order.
Attributes
Returns the Slice without first value.
Returns the Slice without first value.
Attributes
Lazily narrows Slice to first N items.
Lazily narrows Slice to first N items.
Attributes
Lazily narrows Slice to last N items.
Lazily narrows Slice to last N items.
Attributes
Returns a trimmed copy of an underlying array.
Returns a trimmed copy of an underlying array.
Attributes
Returns new list of Slice values.
Returns new list of Slice values.
Attributes
Returns new sequence of Slice values.
Returns new sequence of Slice values.
Attributes
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
-
Function1 -> Any
Returns top index value (length-1).
Returns top index value (length-1).
Attributes
Abstract fields
Returns length of the Slice.
Returns length of the Slice.