IntSlice

com.github.arturopala.bufferandslice.IntSlice
See theIntSlice companion object
final class IntSlice extends ArraySliceLike[Int]

Lazy, specialized slice of the array of integers.

Attributes

Note

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

Companion
object
Graph
Supertypes
trait ArraySliceLike[Int]
trait Slice[Int]
trait Int => Int
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def asBuffer: IntBuffer

Returns a buffer with a copy of this Slice.

Returns a buffer with a copy of this Slice.

Attributes

Definition Classes
def max: Int

Max of all integers.

Max of all integers.

Attributes

def min: Int

Min of all integers.

Min of all integers.

Attributes

def sum: Int

Sums all integers.

Sums all integers.

Attributes

override def toBuffer[T1 >: Int]: Buffer[T1]

Returns buffer with a copy of this Slice.

Returns buffer with a copy of this Slice.

Attributes

Definition Classes

Inherited methods

def andThen[A](g: Int => A): Int => A

Attributes

Inherited from:
Function1
final override def apply(index: Int): Int

Returns value at the given index.

Returns value at the given index.

Attributes

Definition Classes
Slice -> Function1
Inherited from:
Slice
final override def asArray: Array[Int]

Returns a trimmed copy of an underlying array.

Returns a trimmed copy of an underlying array.

Attributes

Definition Classes
Inherited from:
ArraySliceLike
final def asIterable: Iterable[Int]

Returns new iterable of Slice values.

Returns new iterable of Slice values.

Attributes

Inherited from:
Slice
def compose[A](g: A => Int): A => Int

Attributes

Inherited from:
Function1
final override def copyToArray[T1 >: Int](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.

Attributes

Definition Classes
Inherited from:
ArraySliceLike
final def count(pred: Int => Boolean): Int

Counts values fulfilling the predicate.

Counts values fulfilling the predicate.

Attributes

Inherited from:
Slice
final override def detach: ArraySliceLike.this.type

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

Definition Classes
Inherited from:
ArraySliceLike
final def drop(n: Int): Slice.this.type

Lazily narrows Slice to exclude first N items.

Lazily narrows Slice to exclude first N items.

Attributes

Inherited from:
Slice
final def dropRight(n: Int): Slice.this.type

Lazily narrows Slice to exclude last N items.

Lazily narrows Slice to exclude last N items.

Attributes

Inherited from:
Slice
final override def equals(obj: Any): Boolean

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 type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

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
Slice -> Any
Inherited from:
Slice
final def exists(pred: Int => Boolean): Boolean

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

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

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

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

Inherited from:
Slice
final override def hashCode(): Int

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
Slice -> Any
Inherited from:
Slice
final def head: Int

Returns first value in the Slice.

Returns first value in the Slice.

Attributes

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

Returns first value in the Slice.

Returns first value in the Slice.

Attributes

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

Returns iterator over Slice indexes of values fulfilling the predicate.

Returns iterator over Slice indexes of values fulfilling the predicate.

Attributes

Inherited from:
Slice
final def init: Slice.this.type

Returns the Slice without last value.

Returns the Slice without last value.

Attributes

Inherited from:
Slice
final def isEmpty: Boolean

Returns true if Slice has values, otherwise false.

Returns true if Slice has values, otherwise false.

Attributes

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

Returns iterator over Slice values fulfilling the predicate.

Returns iterator over Slice values fulfilling the predicate.

Attributes

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

Returns iterator over Slice values.

Returns iterator over Slice values.

Attributes

Inherited from:
Slice
final def last: Int

Returns the last value in the Slice.

Returns the last value in the Slice.

Attributes

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

Returns the last value in the Slice.

Returns the last value in the Slice.

Attributes

Inherited from:
Slice
final override def map[K](f: Int => K): Slice[K]

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

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

Attributes

Definition Classes
Inherited from:
ArraySliceLike
final def nonEmpty: Boolean

Returns true if Slice has values, otherwise false.

Returns true if Slice has values, otherwise false.

Attributes

Inherited from:
Slice
final override protected def read(index: Int): Int

Returns value at the given index

Returns value at the given index

Attributes

Definition Classes
Inherited from:
ArraySliceLike
final def reduce(f: (Int, Int) => Int): Int

Combines from right to left all elements.

Combines from right to left all elements.

Attributes

Inherited from:
Slice
final def reverseIndexIterator(pred: Int => 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.

Attributes

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

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

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

Returns iterator over Slice values in the reverse order.

Returns iterator over Slice values in the reverse order.

Attributes

Inherited from:
Slice
final override def slice(from: Int, to: Int): ArraySliceLike.this.type

Lazily narrows Slice to provided range.

Lazily narrows Slice to provided range.

Attributes

Definition Classes
Inherited from:
ArraySliceLike
final def tail: Slice.this.type

Returns the Slice without first value.

Returns the Slice without first value.

Attributes

Inherited from:
Slice
final def take(n: Int): Slice.this.type

Lazily narrows Slice to first N items.

Lazily narrows Slice to first N items.

Attributes

Inherited from:
Slice
final def takeRight(n: Int): Slice.this.type

Lazily narrows Slice to last N items.

Lazily narrows Slice to last N items.

Attributes

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

Returns a trimmed copy of an underlying array.

Returns a trimmed copy of an underlying array.

Attributes

Inherited from:
Slice
final def toList: List[Int]

Returns new list of Slice values.

Returns new list of Slice values.

Attributes

Inherited from:
Slice
final def toSeq: Seq[Int]

Returns new sequence of Slice values.

Returns new sequence of Slice values.

Attributes

Inherited from:
Slice
final override def toString: String

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
Slice -> Function1 -> Any
Inherited from:
Slice
final def top: Int

Returns top index value (length-1).

Returns top index value (length-1).

Attributes

Inherited from:
Slice
final override def update[T1 >: Int](index: Int, value: T1): Slice[T1]

Creates a copy of the slice with modified value.

Creates a copy of the slice with modified value.

Attributes

Definition Classes
Inherited from:
ArraySliceLike

Inherited fields

final override val length: Int

Sliced range length.

Sliced range length.

Attributes

Inherited from:
ArraySliceLike