IntSlice

final class IntSlice extends ArraySliceLike[Int]
Lazy, specialized slice of the array of integers.
Note
Truly immutable only if an underlying array kept private, or if detached.
Companion
object
trait ArraySliceLike[Int]
trait Slice[Int]
trait Int => Int
class Object
trait Matchable
class Any

Document{}

@inline
override def toBuffer[T1 >: Int]: Buffer[T1]
Returns buffer with a copy of this Slice.
Definition Classes
def sum: Int
Sums all integers.
def max: Int
Max of all integers.
def min: Int
Min of all integers.
final def lastOption: Option[T]
Returns the last value in the Slice.
Inhertied from
Slice
final def isEmpty: Boolean
Returns true if Slice has values, otherwise false.
Inhertied from
Slice
final def reduce(f: (T, T) => T): T
Combines from right to left all elements.
Inhertied from
Slice
final def foldLeft[R](initial: R)(f: (R, T) => R): R
Folds from left to right all elements, starting with initial.
Inhertied from
Slice
@inline
final def drop(n: Int): Slice
Lazily narrows Slice to exclude first N items.
Inhertied from
Slice
final def last: T
Returns the last value in the Slice.
Inhertied from
Slice
@inline
final def dropRight(n: Int): Slice
Lazily narrows Slice to exclude last N items.
Inhertied from
Slice
@inline
final def top: Int
Returns top index value (length-1).
Inhertied from
Slice
@inline
final def init: Slice
Returns the Slice without last value.
Inhertied from
Slice
final def toArray[T1 >: T](evidence$1: ClassTag[T1]): Array[T1]
Returns a trimmed copy of an underlying array.
Inhertied from
Slice
final def reverseIndexIterator(pred: T => Boolean): Iterator[Int]
Returns iterator over Slice indexes of values fulfilling the predicate, in the reverse order.
Inhertied from
Slice
final def asIterable: Iterable[T]
Returns new iterable of Slice values.
Inhertied from
Slice
@inline
final def tail: Slice
Returns the Slice without first value.
Inhertied from
Slice
@inline
final def toList: List[T]
Returns new list of Slice values.
Inhertied from
Slice
@inline
final def toSeq: Seq[T]
Returns new sequence of Slice values.
Inhertied from
Slice
final def iterator(pred: T => Boolean): Iterator[T]
Returns iterator over Slice values fulfilling the predicate.
Inhertied from
Slice
final def iterator: Iterator[T]
Returns iterator over Slice values.
Inhertied from
Slice
final def headOption: Option[T]
Returns first value in the Slice.
Inhertied from
Slice
final def reverseIterator(pred: T => Boolean): Iterator[T]
Returns iterator over Slice values fulfilling the predicate, in the reverse order.
Inhertied from
Slice
final def reverseIterator: Iterator[T]
Returns iterator over Slice values in the reverse order.
Inhertied from
Slice
final def indexIterator(pred: T => Boolean): Iterator[Int]
Returns iterator over Slice indexes of values fulfilling the predicate.
Inhertied from
Slice
@inline
final def take(n: Int): Slice
Lazily narrows Slice to first N items.
Inhertied from
Slice
final def fold(initial: T)(f: (T, T) => T): T
Combines from left to right all elements, starting with initial.
Inhertied from
Slice
final def foldRight[R](initial: R)(f: (T, R) => R): R
Folds from right to left all elements, starting with initial.
Inhertied from
Slice
final override def apply(index: Int): T
Returns value at the given index.
Definition Classes
Slice -> Function1
Inhertied from
Slice
@inline
final def takeRight(n: Int): Slice
Lazily narrows Slice to last N items.
Inhertied from
Slice
@inline
final def nonEmpty: Boolean
Returns true if Slice has values, otherwise false.
Inhertied from
Slice
final def count(pred: T => Boolean): Int
Counts values fulfilling the predicate.
Inhertied from
Slice

Value members

Methods

@inline
override def asBuffer: IntBuffer
Returns a buffer with a copy of this Slice.
Definition Classes

Inherited methods

final def exists(pred: T => Boolean): Boolean
Returns true if any value fulfills the predicate, or false.
Inhertied from
Slice
@inline
final override protected def read(index: Int): T
Returns value at the given index
Definition Classes
Inhertied from
ArraySliceLike
final override def hashCode(): Int
Definition Classes
Slice -> Any
Inhertied from
Slice
final override def slice(from: Int, to: Int): ArraySliceLike
Lazily narrows Slice to provided range.
Definition Classes
Inhertied from
ArraySliceLike
@unspecialized
def compose[A](g: A => T1): A => R
Inhertied from
Function1
@inline
final override def copyToArray[T1 >: T](targetIndex: Int, targetArray: Array[T1]): Array[T1]
Dumps content to the array, starting from an index.
Definition Classes
Inhertied from
ArraySliceLike
@unspecialized
def andThen[A](g: R => A): T1 => A
Inhertied from
Function1
@inline
final override def map[K](f: T => K): Slice[K]
Lazily composes mapping function and returns new LazyMapArraySlice.
Does not modify nor copy underlying array.
Definition Classes
Inhertied from
ArraySliceLike
final override def toString: String
Definition Classes
Slice -> Function1 -> Any
Inhertied from
Slice
final def find(pred: T => Boolean): Option[T]
Returns Some of the first value fulfilling the predicate, or None.
Inhertied from
Slice
final def get(index: Int): Option[T]
Returns Some of the value at the index,
or None if index outside of range.
Inhertied from
Slice
final override def asArray: Array[T]
Returns a trimmed copy of an underlying array.
Definition Classes
Inhertied from
ArraySliceLike
final override def update[T1 >: T](index: Int, value: T1): Slice[T1]
Creates a copy of the slice with modified value.
Definition Classes
Inhertied from
ArraySliceLike
@inline
final override def detach: ArraySliceLike
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.
Definition Classes
Inhertied from
ArraySliceLike
final override def equals(obj: Any): Boolean
Definition Classes
Slice -> Any
Inhertied from
Slice

Inherited fields

@inline
final override val length: Int
Sliced range length.
Inhertied from
ArraySliceLike