Several

scalax.collection.Several
See theSeveral companion object
final case class Several[+A](head: A, _2: A, more: Iterable[A]) extends NonEmpty[A]

Collection of at least two elements.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait NonEmpty[A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def appended[B >: A](elem: B): Several[B]

Creates a new collection with the elements of this collection and elem appended.

Creates a new collection with the elements of this collection and elem appended.

Attributes

def apply(index: Int): A

The element at index starting with 0 looked up in a non-safe way.

The element at index starting with 0 looked up in a non-safe way.

Attributes

Throws
IndexOutOfBoundsException

if index is negative or greater or equal to this collection's size.

def find(p: A => Boolean): Option[A]

Finds an element satisfying the predicate p if any.

Finds an element satisfying the predicate p if any.

Attributes

def forall(p: A => Boolean): Boolean

Whether all elements satisfy the predicate p.

Whether all elements satisfy the predicate p.

Attributes

def foreach[U](f: A => U): Unit

Calls f on all elements of this collection for side effects.

Calls f on all elements of this collection for side effects.

Attributes

def isDefinedAt(index: Int): Boolean

Whether an element at index exists.

Whether an element at index exists.

Attributes

def iterator: Iterator[A]

Iterates over all elements of this collection.

Iterates over all elements of this collection.

Attributes

def map[B](f: A => B): Several[B]

Builds a new collection by applying a function to all elements of this collection.

Builds a new collection by applying a function to all elements of this collection.

Attributes

def prepended[B >: A](elem: B): Several[B]

Creates a new collection with elem as its first element followed by the elements of this collection.

Creates a new collection with elem as its first element followed by the elements of this collection.

Attributes

def size: Int

The number of elements in this collection.

The number of elements in this collection.

Attributes

Inherited methods

final def ++[B >: A](that: NonEmpty[B]): CC[B]

Alias for concat

Alias for concat

Attributes

Inherited from:
LengtheningOps (hidden)
final def ++[B >: A](that: IterableOnce[B]): CC[B]

Alias for concat

Alias for concat

Attributes

Inherited from:
LengtheningOps (hidden)
final def ++:[B >: A](prefix: NonEmpty[B]): CC[B]

Alias for prependedAll

Alias for prependedAll

Attributes

Inherited from:
LengtheningOps (hidden)
final def ++:[B >: A](prefix: IterableOnce[B]): CC[B]

Alias for prependedAll

Alias for prependedAll

Attributes

Inherited from:
LengtheningOps (hidden)
final def +:[B >: A](elem: B): CC[B]

Alias for prepended

Alias for prepended

Attributes

Inherited from:
LengtheningOps (hidden)
final def :+[B >: A](elem: B): CC[B]

Alias for appended

Alias for appended

Attributes

Inherited from:
LengtheningOps (hidden)
final def :++[B >: A](suffix: NonEmpty[B]): CC[B]

Alias for appendedAll

Alias for appendedAll

Attributes

Inherited from:
LengtheningOps (hidden)
final def :++[B >: A](suffix: IterableOnce[B]): CC[B]

Alias for appendedAll

Alias for appendedAll

Attributes

Inherited from:
LengtheningOps (hidden)
final def appendedAll[B >: A](suffix: NonEmpty[B]): CC[B]

Attributes

Inherited from:
LengtheningOps (hidden)
final def appendedAll[B >: A](suffix: IterableOnce[B]): CC[B]

Attributes

Inherited from:
LengtheningOps (hidden)
protected def apply[B >: A](index: Int, more: Iterable[B], start: Int): B

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def collect[B](pf: PartialFunction[A, B]): SCC[B]

Creates a List with all elements of this collection that satisfy pf

Creates a List with all elements of this collection that satisfy pf

Attributes

Inherited from:
ShorteningOps (hidden)
def collectEither[B](pf: PartialFunction[A, B]): Either[SCC[B], CC[B]]

Same as collect but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Same as collect but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Attributes

Inherited from:
ShorteningEitherOps (hidden)
def concat[B >: A](suffix: IterableOnce[B]): CC[B]

Concatenates the elements of this collection and those of suffix into a new collection.

Concatenates the elements of this collection and those of suffix into a new collection.

Attributes

Inherited from:
LengtheningOps (hidden)
def contains[B >: A](elem: B): Boolean

Whether elem is included in this collection.

Whether elem is included in this collection.

Attributes

Inherited from:
UnchangedSizeOps (hidden)
def exists(p: A => Boolean): Boolean

Whether an element satisfying the predicate p exists.

Whether an element satisfying the predicate p exists.

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def filter(p: A => Boolean): SCC[A]

Creates a List with all elements of this collection that satisfy the predicate p

Creates a List with all elements of this collection that satisfy the predicate p

Attributes

Inherited from:
ShorteningOps (hidden)
def filterEither(p: A => Boolean): Either[SCC[A], CC[A]]

Same as filter but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Same as filter but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Attributes

Inherited from:
ShorteningEitherOps (hidden)
final def filterNot(p: A => Boolean): SCC[A]

Creates a List with all elements of this collection that don't satisfy the predicate p

Creates a List with all elements of this collection that don't satisfy the predicate p

Attributes

Inherited from:
ShorteningOps (hidden)
def filterNotEither(p: A => Boolean): Either[SCC[A], CC[A]]

Same as filterNot but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Same as filterNot but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Attributes

Inherited from:
ShorteningEitherOps (hidden)
final def flatMap[B](f: A => IterableOnce[B]): SCC[B]

Creates a List by applying f to all elements of this collection and using the elements of every result.

Creates a List by applying f to all elements of this collection and using the elements of every result.

Attributes

Inherited from:
ShorteningOps (hidden)
final def flatMapEither[B](f: A => IterableOnce[B]): Either[SCC[B], CC[B]]

Same as flatMap but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Same as flatMap but creates a collection of the same type and returns it in a Right unless the number of remaining elements is too small in which case it escapes to a Left[List].

Attributes

Inherited from:
ShorteningEitherOps (hidden)
def foldLeft[B](zero: B)(f: (B, A) => B): B

Applies f to a start value and all elements of this collection, going left to right.

Applies f to a start value and all elements of this collection, going left to right.

Attributes

Inherited from:
UnchangedSizeOps (hidden)
def get(index: Int): Option[A]

Gets the element at index if any.

Gets the element at index if any.

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def prependedAll[B >: A](prefix: NonEmpty[B]): CC[B]

Attributes

Inherited from:
LengtheningOps (hidden)
final def prependedAll[B >: A](prefix: IterableOnce[B]): CC[B]

Attributes

Inherited from:
LengtheningOps (hidden)

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def reduceLeft[B >: A](f: (B, A) => B): B

Applies f to all elements of this collection, going left to right.

Applies f to all elements of this collection, going left to right.

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def reverse: CC[A]

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def toList: List[A]

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def zip[B](that: NonEmpty[B]): CC[(A, B)]

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def zip[B](that: IterableOnce[B]): CC[(A, B)]

Attributes

Inherited from:
UnchangedSizeOps (hidden)
final def zipWithIndex: CC[(A, Int)]

Attributes

Inherited from:
UnchangedSizeOps (hidden)