Packages

trait Slice[T] extends (Int) => T

Lazy and immutable slice of a sequence of values.

T

type of the items of the sequence.

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.

Linear Supertypes
(Int) => T, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Slice
  2. Function1
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def apply(index: Int): T

    Returns value at the given index.

    Returns value at the given index.

    Definition Classes
    Slice → Function1
  2. abstract def asIterable: Iterable[T]

    Returns new iterable of Slice values.

  3. abstract def copyToArray[T1 >: T](targetIndex: Int, targetArray: Array[T1]): Array[T1]

    Dumps content to the array, starting from an index.

  4. abstract def count(pred: (T) => Boolean): Int

    Counts values fulfilling the predicate.

  5. abstract def detach: Slice.this.type

    Detaches a slice creating a trimmed copy of an underlying data, if needed.

    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.

  6. abstract def drop(n: Int): Slice.this.type

    Lazily narrows Slice to exclude first N items.

  7. abstract def dropRight(n: Int): Slice.this.type

    Lazily narrows Slice to exclude last N items.

  8. abstract def exists(pred: (T) => Boolean): Boolean

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

  9. abstract def find(pred: (T) => Boolean): Option[T]

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

  10. abstract def get(index: Int): Option[T]

    Returns Some of the value at the index, or None if index outside of range.

  11. abstract def head: T

    Returns first value in the Slice.

  12. abstract def headOption: Option[T]

    Returns first value in the Slice.

  13. abstract def init: Slice.this.type

    Returns the Slice without last value.

  14. abstract def isEmpty: Boolean

    Returns true if Slice has values, otherwise false.

  15. abstract def iterator(pred: (T) => Boolean): Iterator[T]

    Returns iterator over Slice values fulfilling the predicate.

  16. abstract def iterator: Iterator[T]

    Returns iterator over Slice values.

  17. abstract def last: T

    Returns the last value in the Slice.

  18. abstract def lastOption: Option[T]

    Returns the last value in the Slice.

  19. abstract def length: Int

    Returns length of the Slice.

  20. abstract def map[K](f: (T) => K): Slice[K]

    Lazily composes mapping function and returns new Slice.

    Lazily composes mapping function and returns new Slice. Does not modify nor copy underlying array.

  21. abstract def reverseIterator(pred: (T) => Boolean): Iterator[T]

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

  22. abstract def reverseIterator: Iterator[T]

    Returns iterator over Slice values in the reverse order.

  23. abstract def slice(from: Int, to: Int): Slice.this.type

    Lazily narrows Slice to provided range.

  24. abstract def tail: Slice.this.type

    Returns the Slice without first value.

  25. abstract def take(n: Int): Slice.this.type

    Lazily narrows Slice to first N items.

  26. abstract def takeRight(n: Int): Slice.this.type

    Lazily narrows Slice to last N items.

  27. abstract def toArray[T1 >: T](implicit arg0: ClassTag[T1]): Array[T1]

    Returns an array of a trimmed copy of an underlying data.

  28. abstract def toBuffer(implicit tag: ClassTag[T]): Buffer[T]

    Returns a buffer with a copy of this Slice.

  29. abstract def toList: List[T]

    Returns new list of Slice values.

  30. abstract def toSeq: Seq[T]

    Returns new sequence of Slice values.

  31. abstract def update[T1 >: T](index: Int, value: T1)(implicit arg0: ClassTag[T1]): Slice[T1]

    Update a value at the given index.

    Update a value at the given index. Creates a copy of an underlying data.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (T) => A): (Int) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def compose[A](g: (A) => Int): (A) => T
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def nonEmpty: Boolean

    Returns true if Slice has values, otherwise false.

    Returns true if Slice has values, otherwise false.

    Annotations
    @inline()
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from (Int) => T

Inherited from AnyRef

Inherited from Any

Properties

Access

Transform

Aggregate

Iterate

Export

Ungrouped