LazyMapArraySlice

abstract class LazyMapArraySlice[T] extends Slice[T]

Lazily mapped slice of an underlying array.

Type parameters:
T

type of the array's items

Note:

Truly immutable only if an underlying array kept private, or if detached.

Companion:
object
trait Slice[T]
trait Int => T
class Object
trait Matchable
class Any

Type members

Types

type A

Type of the underlying array items.

Type of the underlying array items.

Value members

Concrete methods

final override def asArray: Array[T]

Returns an array of mapped values.

Returns an array of mapped values.

Definition Classes
final override def asBuffer: Buffer[T]

Returns a buffer with a copy of this Slice.

Returns a buffer with a copy of this Slice.

Definition Classes
final override def detach: LazyMapArraySlice[T]

Detaches a slice creating a trimmed copy of an underlying data.

Detaches a slice creating a trimmed copy of an underlying data.

Definition Classes
final override def map[K](f: T => K): LazyMapArraySlice[K]

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.

Definition Classes
final override def slice(from: Int, to: Int): LazyMapArraySlice[T]

Lazily narrows Slice to provided range.

Lazily narrows Slice to provided range.

Definition Classes
final override def toBuffer[T1 >: T]: Buffer[T1]

Returns buffer with a copy of this Slice.

Returns buffer with a copy of this Slice.

Definition Classes
final override def update[T1 >: T](index: Int, value: T1): Slice[T1]

Creates a copy of the slice with modified value.

Creates a copy of the slice with modified value.

Definition Classes

Inherited methods

@unspecialized
def andThen[A](g: T => A): Int => A
Inherited from:
Function1
final override def apply(index: Int): T

Returns value at the given index.

Returns value at the given index.

Definition Classes
Slice -> Function1
Inherited from:
Slice
final def asIterable: Iterable[T]

Returns new iterable of Slice values.

Returns new iterable of Slice values.

Inherited from:
Slice
@unspecialized
def compose[A](g: A => Int): A => T
Inherited from:
Function1
def copyToArray[T1 >: T](targetIndex: Int, targetArray: Array[T1]): Array[T1]

Dumps content to the array, starting from an index.

Dumps content to the array, starting from an index.

Inherited from:
Slice
final def count(pred: T => Boolean): Int

Counts values fulfilling the predicate.

Counts values fulfilling the predicate.

Inherited from:
Slice
@inline
final def drop(n: Int): LazyMapArraySlice[T]

Lazily narrows Slice to exclude first N items.

Lazily narrows Slice to exclude first N items.

Inherited from:
Slice
@inline
final def dropRight(n: Int): LazyMapArraySlice[T]

Lazily narrows Slice to exclude last N items.

Lazily narrows Slice to exclude last N items.

Inherited from:
Slice
final override def equals(obj: Any): Boolean
Definition Classes
Slice -> Any
Inherited from:
Slice
final def exists(pred: T => Boolean): Boolean

Returns true if any value fulfills the predicate, or false.

Returns true if any value fulfills the predicate, or false.

Inherited from:
Slice
final def find(pred: T => Boolean): Option[T]

Returns Some of the first value fulfilling the predicate, or None.

Returns Some of the first value fulfilling the predicate, or None.

Inherited from:
Slice
final def fold(initial: T)(f: (T, T) => T): T

Combines from left to right all elements, starting with initial.

Combines from left to right all elements, starting with initial.

Inherited from:
Slice
final def foldLeft[R](initial: R)(f: (R, T) => R): R

Folds from left to right all elements, starting with initial.

Folds from left to right all elements, starting with initial.

Inherited from:
Slice
final def foldRight[R](initial: R)(f: (T, R) => R): R

Folds from right to left all elements, starting with initial.

Folds from right to left all elements, starting with initial.

Inherited from:
Slice
final def get(index: Int): Option[T]

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.

Inherited from:
Slice
final override def hashCode(): Int
Definition Classes
Slice -> Any
Inherited from:
Slice
final def head: T

Returns first value in the Slice.

Returns first value in the Slice.

Inherited from:
Slice
final def headOption: Option[T]

Returns first value in the Slice.

Returns first value in the Slice.

Inherited from:
Slice
final def indexIterator(pred: T => Boolean): Iterator[Int]

Returns iterator over Slice indexes of values fulfilling the predicate.

Returns iterator over Slice indexes of values fulfilling the predicate.

Inherited from:
Slice
@inline
final def init: LazyMapArraySlice[T]

Returns the Slice without last value.

Returns the Slice without last value.

Inherited from:
Slice
final def isEmpty: Boolean

Returns true if Slice has values, otherwise false.

Returns true if Slice has values, otherwise false.

Inherited from:
Slice
final def iterator(pred: T => Boolean): Iterator[T]

Returns iterator over Slice values fulfilling the predicate.

Returns iterator over Slice values fulfilling the predicate.

Inherited from:
Slice
final def iterator: Iterator[T]

Returns iterator over Slice values.

Returns iterator over Slice values.

Inherited from:
Slice
final def last: T

Returns the last value in the Slice.

Returns the last value in the Slice.

Inherited from:
Slice
final def lastOption: Option[T]

Returns the last value in the Slice.

Returns the last value in the Slice.

Inherited from:
Slice
@inline
final def nonEmpty: Boolean

Returns true if Slice has values, otherwise false.

Returns true if Slice has values, otherwise false.

Inherited from:
Slice
final def reduce(f: (T, T) => T): T

Combines from right to left all elements.

Combines from right to left all elements.

Inherited from:
Slice
final def reverseIndexIterator(pred: T => Boolean): Iterator[Int]

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.

Inherited from:
Slice
final def reverseIterator(pred: T => Boolean): Iterator[T]

Returns iterator over Slice values fulfilling the predicate, in the reverse order.

Returns iterator over Slice values fulfilling the predicate, in the reverse order.

Inherited from:
Slice
final def reverseIterator: Iterator[T]

Returns iterator over Slice values in the reverse order.

Returns iterator over Slice values in the reverse order.

Inherited from:
Slice
@inline
final def tail: LazyMapArraySlice[T]

Returns the Slice without first value.

Returns the Slice without first value.

Inherited from:
Slice
@inline
final def take(n: Int): LazyMapArraySlice[T]

Lazily narrows Slice to first N items.

Lazily narrows Slice to first N items.

Inherited from:
Slice
@inline
final def takeRight(n: Int): LazyMapArraySlice[T]

Lazily narrows Slice to last N items.

Lazily narrows Slice to last N items.

Inherited from:
Slice
final def toArray[T1 >: T : ClassTag]: Array[T1]

Returns a trimmed copy of an underlying array.

Returns a trimmed copy of an underlying array.

Inherited from:
Slice
@inline
final def toList: List[T]

Returns new list of Slice values.

Returns new list of Slice values.

Inherited from:
Slice
@inline
final def toSeq: Seq[T]

Returns new sequence of Slice values.

Returns new sequence of Slice values.

Inherited from:
Slice
final override def toString: String
Definition Classes
Slice -> Function1 -> Any
Inherited from:
Slice
@inline
final def top: Int

Returns top index value (length-1).

Returns top index value (length-1).

Inherited from:
Slice

Abstract fields

val array: Array[A]

Underlying array.

Underlying array.

val mapF: A => T

Value mapping function.

Value mapping function.

Concrete fields

final override val length: Int

Sliced range length.

Sliced range length.