final class NEList[+T] extends AnyVal
- Alphabetic
- By Inheritance
- NEList
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def ++[U >: T](other: IterableOnce[U]): NEList[U]
Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedGenTraversableOnce.Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedGenTraversableOnce. The element type of the resultingNEListis the most specific superclass encompassing the element types of thisNEListand the passedGenTraversableOnce.- U
the element type of the returned
NEList- other
the
GenTraversableOnceto append- returns
a new
NEListthat contains all the elements of thisNEListfollowed by all elements ofother.
- def ++[U >: T](other: Vector[U]): NEList[U]
Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedVector.Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedVector. The element type of the resultingNEListis the most specific superclass encompassing the element types of thisNEListand the passedVector.- U
the element type of the returned
NEList- other
the
Vectorto append- returns
a new
NEListthat contains all the elements of thisNEListfollowed by all elements ofother.
- def ++[U >: T](other: NEList[U]): NEList[U]
Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedNEList.Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedNEList. The element type of the resultingNEListis the most specific superclass encompassing the element types of this and the passedNEList.- U
the element type of the returned
NEList- other
the
NEListto append- returns
a new
NEListthat contains all the elements of thisNEListfollowed by all elements ofother.
- def ++:[U >: T](other: IterableOnce[U]): NEList[U]
- Annotations
- @inline()
- def ++:[U >: T](other: Vector[U]): NEList[U]
- Annotations
- @inline()
- def ++:[U >: T](other: NEList[U]): NEList[U]
- Annotations
- @inline()
- def +:[U >: T](element: U): NEList[U]
Returns a new
NEListwith the given element prepended.Returns a new
NEListwith the given element prepended.Note that :-ending operators are right associative. A mnemonic for
+:vs.:+is: the COLon goes on the COLlection side.- element
the element to prepend to this
NEList- returns
a new
NEListconsisting ofelementfollowed by all elements of thisNEList.
- def :+[U >: T](element: U): NEList[U]
Returns a new
NEListwith the given element appended.Returns a new
NEListwith the given element appended.Note a mnemonic for
+:vs.:+is: the COLon goes on the COLlection side.- element
the element to append to this
NEList- returns
a new
NEListconsisting of all elements of thisNEListfollowed byelement.
- def ::[U >: T](element: U): NEList[U]
Adds an element to the beginning of this
NEList.Adds an element to the beginning of this
NEList.Note that :-ending operators are right associative. A mnemonic for
+:vs.:+is: the COLon goes on the COLlection side.- element
the element to prepend to this
NEList- returns
a
NEListthat containselementas first element and that continues with thisNEList.
- def :::[U >: T](other: IterableOnce[U]): NEList[U]
Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedGenTraversableOnce.Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedGenTraversableOnce. The element type of the resultingNEListis the most specific superclass encompassing the element types of thisNEListand the passedGenTraversableOnce.- U
the element type of the returned
NEList- other
the
GenTraversableOnceto append- returns
a new
NEListthat contains all the elements of thisNEListfollowed by all elements ofother.
- def :::[U >: T](other: Vector[U]): NEList[U]
Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedVector.Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedVector. The element type of the resultingNEListis the most specific superclass encompassing the element types of this and the passedVector.- U
the element type of the returned
NEList- other
the
Vectorto append- returns
a new
NEListthat contains all the elements of thisNEListfollowed by all elements ofother.
- def :::[U >: T](other: NEList[U]): NEList[U]
Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedNEList.Returns a new
NEListcontaining the elements of thisNEListfollowed by the elements of the passedNEList. The element type of the resultingNEListis the most specific superclass encompassing the element types of this and the passedNEList.- U
the element type of the returned
NEList- other
the
NEListto append- returns
a new
NEListthat contains all the elements of thisNEListfollowed by all elements ofother.
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def addString(sb: StringBuilder, start: String, sep: String, end: String): StringBuilder
Appends all elements of this
NEListto a string builder using start, end, and separator strings.Appends all elements of this
NEListto a string builder using start, end, and separator strings. The written text will consist of a concatenation of the stringstart; the result of invokingtoStringon all elements of thisNEList, separated by the stringsep; and the stringend- sb
the string builder to which elements will be appended
- start
the ending string
- sep
the separator string
- returns
the string builder,
sb, to which elements were appended.
- def addString(sb: StringBuilder, sep: String): StringBuilder
Appends all elements of this
NEListto a string builder using a separator string.Appends all elements of this
NEListto a string builder using a separator string. The written text will consist of a concatenation of the result of invokingtoStringon of every element of thisNEList, separated by the stringsep.- sb
the string builder to which elements will be appended
- sep
the separator string
- returns
the string builder,
sb, to which elements were appended.
- def addString(sb: StringBuilder): StringBuilder
Appends all elements of this
NEListto a string builder.Appends all elements of this
NEListto a string builder. The written text will consist of a concatenation of the result of invokingtoStringon of every element of thisNEList, without any separator string.- sb
the string builder to which elements will be appended
- returns
the string builder,
sb, to which elements were appended.
- def apply(idx: Int): T
Selects an element by its index in the
NEList.Selects an element by its index in the
NEList.- returns
the element of this
NEListat indexidx, where 0 indicates the first element.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def collectFirst[U](pf: PartialFunction[T, U]): Option[U]
Finds the first element of this
NEListfor which the given partial function is defined, if any, and applies the partial function to it.Finds the first element of this
NEListfor which the given partial function is defined, if any, and applies the partial function to it.- pf
the partial function
- returns
an
Optioncontainingpfapplied to the first element for which it is defined, orNoneif the partial function was not defined for any element.
- def contains(elem: Any): Boolean
Indicates whether this
NEListcontains a given value as an element.Indicates whether this
NEListcontains a given value as an element.- elem
the element to look for
- returns
true if this
NEListhas an element that is equal (as determined by==)toelem, false otherwise.
- def containsSlice[U >: T](that: NEList[U]): Boolean
Indicates whether this
NEListcontains a givenNEListas a slice.Indicates whether this
NEListcontains a givenNEListas a slice.- that
the
NEListslice to look for- returns
true if this
NEListcontains a slice with the same elements asthat, otherwisefalse.
- def containsSlice[U >: T](that: Vector[U]): Boolean
Indicates whether this
NEListcontains a givenVectoras a slice.Indicates whether this
NEListcontains a givenVectoras a slice.- that
the
Vectorslice to look for- returns
true if this
NEListcontains a slice with the same elements asthat, otherwisefalse.
- def containsSlice[U >: T](that: Seq[U]): Boolean
Indicates whether this
NEListcontains a givenSeqas a slice.Indicates whether this
NEListcontains a givenSeqas a slice.- that
the
Seqslice to look for- returns
true if this
NEListcontains a slice with the same elements asthat, otherwisefalse.
- def copyToArray[U >: T](arr: Array[U], start: Int, len: Int): Unit
Copies values of this
NEListto an array.Copies values of this
NEListto an array. Fills the given arrayarrwith at mostlenelements of thisNEList, beginning at indexstart. Copying will stop once either the end of the currentNEListis reached, the end of the array is reached, orlenelements have been copied.- arr
the array to fill
- start
the starting index
- len
the maximum number of elements to copy
- def copyToArray[U >: T](arr: Array[U], start: Int): Unit
Copies values of this
NEListto an array.Copies values of this
NEListto an array. Fills the given arrayarrwith values of thisNEList, beginning at indexstart. Copying will stop once either the end of the currentNEListis reached, or the end of the array is reached.- arr
the array to fill
- start
the starting index
- def copyToArray[U >: T](arr: Array[U]): Unit
Copies values of this
NEListto an array.Copies values of this
NEListto an array. Fills the given arrayarrwith values of thisNEList. Copying will stop once either the end of the currentNEListis reached, or the end of the array is reached.- arr
the array to fill
- def copyToBuffer[U >: T](buf: Buffer[U]): Unit
Copies all elements of this
NEListto a buffer.Copies all elements of this
NEListto a buffer.- buf
the buffer to which elements are copied
- def corresponds[B](that: NEList[B])(p: (T, B) => Boolean): Boolean
Indicates whether every element of this
NEListrelates to the corresponding element of a givenNEListby satisfying a given predicate.Indicates whether every element of this
NEListrelates to the corresponding element of a givenNEListby satisfying a given predicate.- B
the type of the elements of
that- that
the
NEListto compare for correspondence- p
the predicate, which relates elements from this and the passed
NEList- returns
true if this and the passed
NEListhave the same length andp(x, y)istruefor all corresponding elementsxof thisNEListandyof that, otherwisefalse.
- def corresponds[B](that: Vector[B])(p: (T, B) => Boolean): Boolean
Indicates whether every element of this
NEListrelates to the corresponding element of a givenVectorby satisfying a given predicate.Indicates whether every element of this
NEListrelates to the corresponding element of a givenVectorby satisfying a given predicate.- B
the type of the elements of
that- that
the
Vectorto compare for correspondence- p
the predicate, which relates elements from this
NEListand the passedVector- returns
true if this
NEListand the passedVectorhave the same length andp(x, y)istruefor all corresponding elementsxof thisNEListandyof that, otherwisefalse.
- def corresponds[B](that: Seq[B])(p: (T, B) => Boolean): Boolean
Indicates whether every element of this
NEListrelates to the corresponding element of a givenSeqby satisfying a given predicate.Indicates whether every element of this
NEListrelates to the corresponding element of a givenSeqby satisfying a given predicate.- B
the type of the elements of
that- that
the
Seqto compare for correspondence- p
the predicate, which relates elements from this
NEListand the passedSeq- returns
true if this
NEListand the passedSeqhave the same length andp(x, y)istruefor all corresponding elementsxof thisNEListandyof that, otherwisefalse.
- def count(p: (T) => Boolean): Int
Counts the number of elements in this
NEListthat satisfy a predicate.Counts the number of elements in this
NEListthat satisfy a predicate.- p
the predicate used to test elements.
- returns
the number of elements satisfying the predicate
p.
- def distinct: NEList[T]
Builds a new
NEListfrom thisNEListwithout any duplicate elements.Builds a new
NEListfrom thisNEListwithout any duplicate elements.- returns
A new
NEListthat contains the first occurrence of every element of thisNEList.
- def endsWith[B](that: NEList[B]): Boolean
Indicates whether this
NEListends with the givenNEList.Indicates whether this
NEListends with the givenNEList.- that
the
NEListto test- returns
trueif thisNEListhasthatas a suffix,falseotherwise.
- def endsWith[B](that: Vector[B]): Boolean
Indicates whether this
NEListends with the givenVector.Indicates whether this
NEListends with the givenVector.- that
the
Vectorto test- returns
trueif thisNEListhasthatas a suffix,falseotherwise.
- def endsWith[B](that: Seq[B]): Boolean
Indicates whether this
NEListends with the givenSeq.Indicates whether this
NEListends with the givenSeq.- that
the sequence to test
- returns
trueif thisNEListhasthatas a suffix,falseotherwise.
- def exists(p: (T) => Boolean): Boolean
Indicates whether a predicate holds for at least one of the elements of this
NEList.Indicates whether a predicate holds for at least one of the elements of this
NEList.- returns
trueif the given predicatepholds for some of the elements of thisNEList, otherwisefalse.
- def find(p: (T) => Boolean): Option[T]
Finds the first element of this
NEListthat satisfies the given predicate, if any.Finds the first element of this
NEListthat satisfies the given predicate, if any.- p
the predicate used to test elements
- returns
an
Somecontaining the first element in thisNEListthat satisfiesp, orNoneif none exists.
- def flatMap[U](f: (T) => NEList[U]): NEList[U]
Builds a new
NEListby applying a function to all elements of thisNEListand using the elements of the resultingNELists.Builds a new
NEListby applying a function to all elements of thisNEListand using the elements of the resultingNELists.- U
the element type of the returned
NEList- f
the function to apply to each element.
- returns
a new
NEListcontaining elements obtained by applying the given functionfto each element of thisNEListand concatenating the elements of resultingNELists.
- def flatten[B](implicit ev: <:<[T, NEList[B]]): NEList[B]
Converts this
NEListofNELists into aNEListformed by the elements of the nestedNELists.Converts this
NEListofNELists into aNEListformed by the elements of the nestedNELists.- returns
a new
NEListresulting from concatenating all nestedNELists.
- Note
You cannot use this
flattenmethod on aNEListthat contains aGenTraversableOnces, because if all the nestedGenTraversableOnces were empty, you'd end up with an emptyNEList.
- def fold[U >: T](z: U)(op: (U, U) => U): U
Folds the elements of this
NEListusing the specified associative binary operator.Folds the elements of this
NEListusing the specified associative binary operator.The order in which operations are performed on elements is unspecified and may be nondeterministic.
- U
a type parameter for the binary operator, a supertype of T.
- z
a neutral element for the fold operation; may be added to the result an arbitrary number of times, and must not change the result (e.g.,
Nilfor list concatenation, 0 for addition, or 1 for multiplication.)- op
a binary operator that must be associative
- returns
the result of applying fold operator
opbetween all the elements andz
- def foldLeft[B](z: B)(op: (B, T) => B): B
Applies a binary operator to a start value and all elements of this
NEList, going left to right.Applies a binary operator to a start value and all elements of this
NEList, going left to right.- B
the result type of the binary operator.
- z
the start value.
- op
the binary operator.
- returns
the result of inserting
opbetween consecutive elements of thisNEList, going left to right, with the start value,z, on the left:op(...op(op(z, x_1), x_2), ..., x_n)
where x1, ..., xn are the elements of thisNEList.
- def foldRight[B](z: B)(op: (T, B) => B): B
Applies a binary operator to all elements of this
NEListand a start value, going right to left.Applies a binary operator to all elements of this
NEListand a start value, going right to left.- B
the result of the binary operator
- z
the start value
- op
the binary operator
- returns
the result of inserting
opbetween consecutive elements of thisNEList, going right to left, with the start value,z, on the right:op(x_1, op(x_2, ... op(x_n, z)...))
where x1, ..., xn are the elements of thisNEList.
- def forall(p: (T) => Boolean): Boolean
Indicates whether a predicate holds for all elements of this
NEList.Indicates whether a predicate holds for all elements of this
NEList.- p
the predicate used to test elements.
- returns
trueif the given predicatepholds for all elements of thisNEList, otherwisefalse.
- def foreach(f: (T) => Unit): Unit
Applies a function
fto all elements of thisNEList.Applies a function
fto all elements of thisNEList.- f
the function that is applied for its side-effect to every element. The result of function
fis discarded.
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def groupBy[K](f: (T) => K): Map[K, NEList[T]]
Partitions this
NEListinto a map ofNELists according to some discriminator function.Partitions this
NEListinto a map ofNELists according to some discriminator function.- K
the type of keys returned by the discriminator function.
- f
the discriminator function.
- returns
A map from keys to
NELists such that the following invariant holds:(NEList.toList partition f)(k) = xs filter (x => f(x) == k)
That is, every keykis bound to aNEListof those elementsxfor whichf(x)equalsk.
- def grouped(size: Int): Iterator[NEList[T]]
Partitions elements into fixed size
NELists.Partitions elements into fixed size
NELists.- size
the number of elements per group
- returns
An iterator producing
NELists of sizesize, except the last will be truncated if the elements don't divide evenly.
- def hasDefiniteSize: Boolean
Returns
trueto indicate thisNEListhas a definite size, since allNELists are strict collections. - def head: T
Selects the first element of this
NEList.Selects the first element of this
NEList.- returns
the first element of this
NEList.
- def indexOf[U >: T](elem: U, from: Int): Int
Finds index of first occurrence of some value in this
NEListafter or at some start index.Finds index of first occurrence of some value in this
NEListafter or at some start index.- elem
the element value to search for.
- from
the start index
- returns
the index
>=fromof the first element of thisNEListthat is equal (as determined by==) toelem, or-1, if none exists.
- def indexOf[U >: T](elem: U): Int
Finds index of first occurrence of some value in this
NEList.Finds index of first occurrence of some value in this
NEList.- elem
the element value to search for.
- returns
the index of the first element of this
NEListthat is equal (as determined by==) toelem, or-1, if none exists.
- def indexOfSlice[U >: T](that: NEList[U], from: Int): Int
Finds first index after or at a start index where this
NEListcontains a givenNEListas a slice.Finds first index after or at a start index where this
NEListcontains a givenNEListas a slice.- that
the
NEListdefining the slice to look for- from
the start index
- returns
the first index
>=fromsuch that the elements of thisNEListstarting at this index match the elements ofNEListthat, or-1of no such subsequence exists.
- def indexOfSlice[U >: T](that: Vector[U], from: Int): Int
Finds first index after or at a start index where this
NEListcontains a givenVectoras a slice.Finds first index after or at a start index where this
NEListcontains a givenVectoras a slice.- that
the
Vectordefining the slice to look for- from
the start index
- returns
the first index
>=fromsuch that the elements of thisNEListstarting at this index match the elements ofVectorthat, or-1of no such subsequence exists.
- def indexOfSlice[U >: T](that: NEList[U]): Int
Finds first index where this
NEListcontains a givenNEListas a slice.Finds first index where this
NEListcontains a givenNEListas a slice.- that
the
NEListdefining the slice to look for- returns
the first index such that the elements of this
NEListstarting at this index match the elements ofNEListthat, or-1of no such subsequence exists.
- def indexOfSlice[U >: T](that: Vector[U]): Int
Finds first index where this
NEListcontains a givenVectoras a slice.Finds first index where this
NEListcontains a givenVectoras a slice.- that
the
Vectordefining the slice to look for- returns
the first index such that the elements of this
NEListstarting at this index match the elements ofVectorthat, or-1of no such subsequence exists.
- def indexOfSlice[U >: T](that: Seq[U], from: Int): Int
Finds first index after or at a start index where this
NEListcontains a givenSeqas a slice.Finds first index after or at a start index where this
NEListcontains a givenSeqas a slice.- that
the
Seqdefining the slice to look for- from
the start index
- returns
the first index
>=fromat which the elements of thisNEListstarting at that index match the elements ofSeqthat, or-1of no such subsequence exists.
- def indexOfSlice[U >: T](that: Seq[U]): Int
Finds first index where this
NEListcontains a givenSeqas a slice.Finds first index where this
NEListcontains a givenSeqas a slice.- that
the
Seqdefining the slice to look for- returns
the first index at which the elements of this
NEListstarting at that index match the elements ofSeqthat, or-1of no such subsequence exists.
- def indexWhere(p: (T) => Boolean, from: Int): Int
Finds index of the first element satisfying some predicate after or at some start index.
Finds index of the first element satisfying some predicate after or at some start index.
- p
the predicate used to test elements.
- from
the start index
- returns
the index
>=fromof the first element of thisNEListthat satisfies the predicatep, or-1, if none exists.
- def indexWhere(p: (T) => Boolean): Int
Finds index of the first element satisfying some predicate.
Finds index of the first element satisfying some predicate.
- p
the predicate used to test elements.
- returns
the index of the first element of this
NEListthat satisfies the predicatep, or-1, if none exists.
- def indices: Range
Produces the range of all indices of this
NEList.Produces the range of all indices of this
NEList.- returns
a
Rangevalue from0to one less than the length of thisNEList.
- def isDefinedAt(idx: Int): Boolean
Tests whether this
NEListcontains given index.Tests whether this
NEListcontains given index.- idx
the index to test
- returns
true if this
NEListcontains an element at positionidx,falseotherwise.
- def isEmpty: Boolean
Returns
falseto indicate thisNEList, like allNELists, is non-empty.Returns
falseto indicate thisNEList, like allNELists, is non-empty.- returns
false
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraversableAgain: Boolean
Returns
trueto indicate thisNEList, like allNELists, can be traversed repeatedly.Returns
trueto indicate thisNEList, like allNELists, can be traversed repeatedly.- returns
true
- def iterator: Iterator[T]
Creates and returns a new iterator over all elements contained in this
NEList.Creates and returns a new iterator over all elements contained in this
NEList.- returns
the new iterator
- def last: T
Selects the last element of this
NEList.Selects the last element of this
NEList.- returns
the last element of this
NEList.
- def lastIndexOf[U >: T](elem: U, end: Int): Int
Finds the index of the last occurrence of some value in this
NEListbefore or at a givenendindex.Finds the index of the last occurrence of some value in this
NEListbefore or at a givenendindex.- elem
the element value to search for.
- end
the end index.
- returns
the index
>=endof the last element of thisNEListthat is equal (as determined by==) toelem, or-1, if none exists.
- def lastIndexOf[U >: T](elem: U): Int
Finds the index of the last occurrence of some value in this
NEList.Finds the index of the last occurrence of some value in this
NEList.- elem
the element value to search for.
- returns
the index of the last element of this
NEListthat is equal (as determined by==) toelem, or-1, if none exists.
- def lastIndexOfSlice[U >: T](that: NEList[U], end: Int): Int
Finds the last index before or at a given end index where this
NEListcontains a givenNEListas a slice.Finds the last index before or at a given end index where this
NEListcontains a givenNEListas a slice.- that
the
NEListdefining the slice to look for- end
the end index
- returns
the last index
>=endat which the elements of thisNEListstarting at that index match the elements ofNEListthat, or-1of no such subsequence exists.
- def lastIndexOfSlice[U >: T](that: Vector[U], end: Int): Int
Finds the last index before or at a given end index where this
NEListcontains a givenVectoras a slice.Finds the last index before or at a given end index where this
NEListcontains a givenVectoras a slice.- that
the
Vectordefining the slice to look for- end
the end index
- returns
the last index
>=endat which the elements of thisNEListstarting at that index match the elements ofVectorthat, or-1of no such subsequence exists.
- def lastIndexOfSlice[U >: T](that: NEList[U]): Int
Finds the last index where this
NEListcontains a givenNEListas a slice.Finds the last index where this
NEListcontains a givenNEListas a slice.- that
the
NEListdefining the slice to look for- returns
the last index at which the elements of this
NEListstarting at that index match the elements ofNEListthat, or-1of no such subsequence exists.
- def lastIndexOfSlice[U >: T](that: Vector[U]): Int
Finds the last index where this
NEListcontains a givenVectoras a slice.Finds the last index where this
NEListcontains a givenVectoras a slice.- that
the
Vectordefining the slice to look for- returns
the last index at which the elements of this
NEListstarting at that index match the elements ofVectorthat, or-1of no such subsequence exists.
- def lastIndexOfSlice[U >: T](that: Seq[U], end: Int): Int
Finds the last index before or at a given end index where this
NEListcontains a givenSeqas a slice.Finds the last index before or at a given end index where this
NEListcontains a givenSeqas a slice.- that
the
Seqdefining the slice to look for- end
the end index
- returns
the last index
>=endat which the elements of thisNEListstarting at that index match the elements ofSeqthat, or-1of no such subsequence exists.
- def lastIndexOfSlice[U >: T](that: Seq[U]): Int
Finds the last index where this
NEListcontains a givenSeqas a slice.Finds the last index where this
NEListcontains a givenSeqas a slice.- that
the
Seqdefining the slice to look for- returns
the last index at which the elements of this
NEListstarting at that index match the elements ofSeqthat, or-1of no such subsequence exists.
- def lastIndexWhere(p: (T) => Boolean, end: Int): Int
Finds index of last element satisfying some predicate before or at given end index.
Finds index of last element satisfying some predicate before or at given end index.
- p
the predicate used to test elements.
- end
the end index
- returns
the index
>=endof the last element of thisNEListthat satisfies the predicatep, or-1, if none exists.
- def lastIndexWhere(p: (T) => Boolean): Int
Finds index of last element satisfying some predicate.
Finds index of last element satisfying some predicate.
- p
the predicate used to test elements.
- returns
the index of the last element of this
NEListthat satisfies the predicatep, or-1, if none exists.
- def length: Int
The length of this
NEList.The length of this
NEList.- returns
the number of elements in this
NEList.
- Note
lengthandsizeyield the same result, which will be>= 1.
- def lengthCompare(len: Int): Int
Compares the length of this
NEListto a test value.Compares the length of this
NEListto a test value.- len
the test value that gets compared with the length.
- returns
a value
xwherex < 0 if this.length < len x == 0 if this.length == len x > 0 if this.length > len
- def map[U](f: (T) => U): NEList[U]
Builds a new
NEListby applying a function to all elements of thisNEList.Builds a new
NEListby applying a function to all elements of thisNEList.- U
the element type of the returned
NEList.- f
the function to apply to each element.
- returns
a new
NEListresulting from applying the given functionfto each element of thisNEListand collecting the results.
- def max[U >: T](implicit cmp: Ordering[U]): T
Finds the largest element.
Finds the largest element.
- returns
the largest element of this
NEList.
- def maxBy[U](f: (T) => U)(implicit cmp: Ordering[U]): T
Finds the largest result after applying the given function to every element.
Finds the largest result after applying the given function to every element.
- returns
the largest result of applying the given function to every element of this
NEList.
- def min[U >: T](implicit cmp: Ordering[U]): T
Finds the smallest element.
Finds the smallest element.
- returns
the smallest element of this
NEList.
- def minBy[U](f: (T) => U)(implicit cmp: Ordering[U]): T
Finds the smallest result after applying the given function to every element.
Finds the smallest result after applying the given function to every element.
- returns
the smallest result of applying the given function to every element of this
NEList.
- def mkString(start: String, sep: String, end: String): String
Displays all elements of this
NEListin a string using start, end, and separator strings.Displays all elements of this
NEListin a string using start, end, and separator strings.- start
the starting string.
- sep
the separator string.
- end
the ending string.
- returns
a string representation of this
NEList. The resulting string begins with the stringstartand ends with the stringend. Inside, In the resulting string, the result of invokingtoStringon all elements of thisNEListare separated by the stringsep.
- def mkString(sep: String): String
Displays all elements of this
NEListin a string using a separator string.Displays all elements of this
NEListin a string using a separator string.- sep
the separator string
- returns
a string representation of this
NEList. In the resulting string, the result of invokingtoStringon all elements of thisNEListare separated by the stringsep.
- def mkString: String
Displays all elements of this
NEListin a string.Displays all elements of this
NEListin a string.- returns
a string representation of this
NEList. In the resulting string, the result of invokingtoStringon all elements of thisNEListfollow each other without any separator string.
- def nonEmpty: Boolean
Returns
trueto indicate thisNEList, like allNELists, is non-empty.Returns
trueto indicate thisNEList, like allNELists, is non-empty.- returns
true
- def padTo[U >: T](len: Int, elem: U): NEList[U]
A copy of this
NEListwith an element value appended until a given target length is reached.A copy of this
NEListwith an element value appended until a given target length is reached.- len
the target length
- elem
he padding value
- returns
a new
NEListconsisting of all elements of thisNEListfollowed by the minimal number of occurrences ofelemso that the resultingNEListhas a length of at leastlen.
- def patch[U >: T](from: Int, that: NEList[U], replaced: Int): NEList[U]
Produces a new
NEListwhere a slice of elements in thisNEListis replaced by anotherNEListProduces a new
NEListwhere a slice of elements in thisNEListis replaced by anotherNEList- from
the index of the first replaced element
- that
the
NEListwhose elements should replace a slice in thisNEList- replaced
the number of elements to drop in the original
NEList
- def permutations: Iterator[NEList[T]]
Iterates over distinct permutations.
Iterates over distinct permutations.
Here's an example:
NEList('a', 'b', 'b').permutations.toList = List(NEList(a, b, b), NEList(b, a, b), NEList(b, b, a))- returns
an iterator that traverses the distinct permutations of this
NEList.
- def prefixLength(p: (T) => Boolean): Int
Returns the length of the longest prefix whose elements all satisfy some predicate.
Returns the length of the longest prefix whose elements all satisfy some predicate.
- p
the predicate used to test elements.
- returns
the length of the longest prefix of this
NEListsuch that every element of the segment satisfies the predicatep.
- def product[U >: T](implicit num: Numeric[U]): U
The result of multiplying all the elements of this
NEList.The result of multiplying all the elements of this
NEList.This method can be invoked for any
NEList[T]for which an implicitNumeric[T]exists.- returns
the product of all elements
- def reduce[U >: T](op: (U, U) => U): U
Reduces the elements of this
NEListusing the specified associative binary operator.Reduces the elements of this
NEListusing the specified associative binary operator.The order in which operations are performed on elements is unspecified and may be nondeterministic.
- U
a type parameter for the binary operator, a supertype of T.
- op
a binary operator that must be associative.
- returns
the result of applying reduce operator
opbetween all the elements of thisNEList.
- def reduceLeft[U >: T](op: (U, T) => U): U
Applies a binary operator to all elements of this
NEList, going left to right.Applies a binary operator to all elements of this
NEList, going left to right.- U
the result type of the binary operator.
- op
the binary operator.
- returns
the result of inserting
opbetween consecutive elements of thisNEList, going left to right:op(...op(op(x_1, x_2), x_3), ..., x_n)
where x1, ..., xn are the elements of thisNEList.
- def reduceLeftOption[U >: T](op: (U, T) => U): Option[U]
Applies a binary operator to all elements of this
NEList, going left to right, returning the result in aSome.Applies a binary operator to all elements of this
NEList, going left to right, returning the result in aSome.- U
the result type of the binary operator.
- op
the binary operator.
- returns
a
Somecontaining the result ofreduceLeft(op)
- def reduceOption[U >: T](op: (U, U) => U): Option[U]
- def reduceRight[U >: T](op: (T, U) => U): U
Applies a binary operator to all elements of this
NEList, going right to left.Applies a binary operator to all elements of this
NEList, going right to left.- U
the result of the binary operator
- op
the binary operator
- returns
the result of inserting
opbetween consecutive elements of thisNEList, going right to left:op(x_1, op(x_2, ... op(x_{n-1}, x_n)...))where x1, ..., xn are the elements of thisNEList.
- def reduceRightOption[U >: T](op: (T, U) => U): Option[U]
Applies a binary operator to all elements of this
NEList, going right to left, returning the result in aSome.Applies a binary operator to all elements of this
NEList, going right to left, returning the result in aSome.- U
the result of the binary operator
- op
the binary operator
- returns
a
Somecontaining the result ofreduceRight(op)
- def reverse: NEList[T]
Returns new
NEListwith elements in reverse order.Returns new
NEListwith elements in reverse order.- returns
a new
NEListwith all elements of thisNEListin reversed order.
- def reverseIterator: Iterator[T]
An iterator yielding elements in reverse order.
An iterator yielding elements in reverse order.
- returns
an iterator yielding the elements of this
NEListin reversed order
- Note
NEList.reverseIteratoris the same asNEList.reverse.iterator, but might be more efficient.
- def reverseMap[U](f: (T) => U): NEList[U]
Builds a new
NEListby applying a function to all elements of thisNEListand collecting the results in reverse order.Builds a new
NEListby applying a function to all elements of thisNEListand collecting the results in reverse order.- U
the element type of the returned
NEList.- f
the function to apply to each element.
- returns
a new
NEListresulting from applying the given functionfto each element of thisNEListand collecting the results in reverse order.
- Note
NEList.reverseMap(f)is the same asNEList.reverse.map(f), but might be more efficient.
- def sameElements[U >: T](that: NEList[U]): Boolean
Checks if the given
NEListcontains the same elements in the same order as thisNEList.Checks if the given
NEListcontains the same elements in the same order as thisNEList.- that
the
NEListwith which to compare- returns
true, if both this and the givenNEListcontain the same elements in the same order,falseotherwise.
- def sameElements[U >: T](that: Vector[U]): Boolean
Checks if the given
Vectorcontains the same elements in the same order as thisNEList.Checks if the given
Vectorcontains the same elements in the same order as thisNEList.- that
the
Vectorwith which to compare- returns
true, if both this and the givenVectorcontain the same elements in the same order,falseotherwise.
- def sameElements[U >: T](that: Iterable[U]): Boolean
Checks if the given
Iterablecontains the same elements in the same order as thisNEList.Checks if the given
Iterablecontains the same elements in the same order as thisNEList.- that
the
Iterablewith which to compare- returns
true, if both thisNEListand the givenIterablecontain the same elements in the same order,falseotherwise.
- def scan[U >: T](z: U)(op: (U, U) => U): NEList[U]
Computes a prefix scan of the elements of this
NEList.Computes a prefix scan of the elements of this
NEList.- U
a type parameter for the binary operator, a supertype of T, and the type of the resulting
NEList.- z
a neutral element for the scan operation; may be added to the result an arbitrary number of times, and must not change the result (e.g.,
Nilfor list concatenation, 0 for addition, or 1 for multiplication.)- op
a binary operator that must be associative
- returns
a new
NEListcontaining the prefix scan of the elements in thisNEList
- Note
The neutral element z may be applied more than once. Here are some examples:
NEList(1, 2, 3).scan(0)(_ + _) == NEList(0, 1, 3, 6) NEList(1, 2, 3).scan("z")(_ + _.toString) == NEList("z", "z1", "z12", "z123")
- def scanLeft[B](z: B)(op: (B, T) => B): NEList[B]
Produces a
NEListcontaining cumulative results of applying the operator going left to right.Produces a
NEListcontaining cumulative results of applying the operator going left to right.Here are some examples:
NEList(1, 2, 3).scanLeft(0)(_ + _) == NEList(0, 1, 3, 6) NEList(1, 2, 3).scanLeft("z")(_ + _) == NEList("z", "z1", "z12", "z123")- B
the result type of the binary operator and type of the resulting
NEList- z
the start value.
- op
the binary operator.
- returns
a new
NEListcontaining the intermediate results of insertingopbetween consecutive elements of thisNEList, going left to right, with the start value,z, on the left.
- def scanRight[B](z: B)(op: (T, B) => B): NEList[B]
Produces a
NEListcontaining cumulative results of applying the operator going right to left.Produces a
NEListcontaining cumulative results of applying the operator going right to left.Here are some examples:
NEList(1, 2, 3).scanRight(0)(_ + _) == NEList(6, 5, 3, 0) NEList(1, 2, 3).scanRight("z")(_ + _) == NEList("123z", "23z", "3z", "z")- B
the result of the binary operator and type of the resulting
NEList- z
the start value
- op
the binary operator
- returns
a new
NEListcontaining the intermediate results of insertingopbetween consecutive elements of thisNEList, going right to left, with the start value,z, on the right.
- def segmentLength(p: (T) => Boolean, from: Int): Int
Computes length of longest segment whose elements all satisfy some predicate.
Computes length of longest segment whose elements all satisfy some predicate.
- p
the predicate used to test elements.
- from
the index where the search starts.
- def size: Int
The size of this
NEList.The size of this
NEList.- returns
the number of elements in this
NEList.
- Note
lengthandsizeyield the same result, which will be>= 1.
- def sliding(size: Int, step: Int): Iterator[NEList[T]]
Groups elements in fixed size blocks by passing a “sliding window” over them (as opposed to partitioning them, as is done in grouped.), moving the sliding window by a given
stepeach time.Groups elements in fixed size blocks by passing a “sliding window” over them (as opposed to partitioning them, as is done in grouped.), moving the sliding window by a given
stepeach time.- size
the number of elements per group
- step
the distance between the first elements of successive groups
- returns
an iterator producing
NELists of sizesize, except the last and the only element will be truncated if there are fewer elements thansize.
- def sliding(size: Int): Iterator[NEList[T]]
Groups elements in fixed size blocks by passing a “sliding window” over them (as opposed to partitioning them, as is done in grouped.)
Groups elements in fixed size blocks by passing a “sliding window” over them (as opposed to partitioning them, as is done in grouped.)
- size
the number of elements per group
- returns
an iterator producing
NELists of sizesize, except the last and the only element will be truncated if there are fewer elements thansize.
- def sortBy[U](f: (T) => U)(implicit ord: Ordering[U]): NEList[T]
Sorts this
NEListaccording to theOrderingof the result of applying the given function to every element.Sorts this
NEListaccording to theOrderingof the result of applying the given function to every element.- U
the target type of the transformation
f, and the type where theOrderingordis defined.- f
the transformation function mapping elements to some other domain
U.- ord
the ordering assumed on domain
U.- returns
a
NEListconsisting of the elements of thisNEListsorted according to theOrderingwherex < y if ord.lt(f(x), f(y)).
- def sortWith(lt: (T, T) => Boolean): NEList[T]
Sorts this
NEListaccording to a comparison function.Sorts this
NEListaccording to a comparison function.The sort is stable. That is, elements that are equal (as determined by
lt) appear in the same order in the sortedNEListas in the original.- returns
a
NEListconsisting of the elements of thisNEListsorted according to the comparison functionlt.
- def sorted[U >: T](implicit ord: Ordering[U]): NEList[U]
Sorts this
NEListaccording to anOrdering.Sorts this
NEListaccording to anOrdering.The sort is stable. That is, elements that are equal (as determined by
lt) appear in the same order in the sortedNEListas in the original.- ord
the
Orderingto be used to compare elements.- returns
a
NEListconsisting of the elements of thisNEListsorted according to the comparison functionlt.
- def startsWith[B](that: NEList[B], offset: Int): Boolean
Indicates whether this
NEListstarts with the givenNEListat the given index.Indicates whether this
NEListstarts with the givenNEListat the given index.- that
the
NEListslice to look for in thisNEList- offset
the index at which this
NEListis searched.- returns
trueif thisNEListhasthatas a slice at the indexoffset,falseotherwise.
- def startsWith[B](that: Vector[B], offset: Int): Boolean
Indicates whether this
NEListstarts with the givenVectorat the given index.Indicates whether this
NEListstarts with the givenVectorat the given index.- that
the
Vectorslice to look for in thisNEList- offset
the index at which this
NEListis searched.- returns
trueif thisNEListhasthatas a slice at the indexoffset,falseotherwise.
- def startsWith[B](that: NEList[B]): Boolean
Indicates whether this
NEListstarts with the givenNEList.Indicates whether this
NEListstarts with the givenNEList.- that
the
NEListto test- returns
trueif this collection hasthatas a prefix,falseotherwise.
- def startsWith[B](that: Vector[B]): Boolean
Indicates whether this
NEListstarts with the givenVector.Indicates whether this
NEListstarts with the givenVector.- that
the
Vectorto test- returns
trueif this collection hasthatas a prefix,falseotherwise.
- def startsWith[B](that: Seq[B], offset: Int): Boolean
Indicates whether this
NEListstarts with the givenSeqat the given index.Indicates whether this
NEListstarts with the givenSeqat the given index.- that
the
Seqslice to look for in thisNEList- offset
the index at which this
NEListis searched.- returns
trueif thisNEListhasthatas a slice at the indexoffset,falseotherwise.
- def startsWith[B](that: Seq[B]): Boolean
Indicates whether this
NEListstarts with the givenSeq.Indicates whether this
NEListstarts with the givenSeq.- that
the
Seqslice to look for in thisNEList- returns
trueif thisNEListhasthatas a prefix,falseotherwise.
- def stringPrefix: String
Returns
"NEList", the prefix of this object'stoStringrepresentation.Returns
"NEList", the prefix of this object'stoStringrepresentation.- returns
the string
"NEList"
- def sum[U >: T](implicit num: Numeric[U]): U
The result of summing all the elements of this
NEList.The result of summing all the elements of this
NEList.This method can be invoked for any
NEList[T]for which an implicitNumeric[T]exists.- returns
the sum of all elements
- def tail: List[T]
- def to[C1](factory: Factory[T, C1]): C1
Converts this
NEListinto a collection of typeColby copying all elements.Converts this
NEListinto a collection of typeColby copying all elements.- C1
the collection type to build.
- returns
a new collection containing all elements of this
NEList.
- def toArray[U >: T](implicit classTag: ClassTag[U]): Array[U]
Converts this
NEListto an array.Converts this
NEListto an array.- returns
an array containing all elements of this
NEList. AClassTagmust be available for the element type of thisNEList.
- def toBuffer[U >: T]: Buffer[U]
Converts this
NEListto a mutable buffer.Converts this
NEListto a mutable buffer.- returns
a buffer containing all elements of this
NEList.
- def toIndexedSeq: IndexedSeq[T]
Converts this
NEListto an immutableIndexedSeq.Converts this
NEListto an immutableIndexedSeq.- returns
an immutable
IndexedSeqcontaining all elements of thisNEList.
- def toIterable: Iterable[T]
Converts this
NEListto an iterable collection.Converts this
NEListto an iterable collection.- returns
an
Iterablecontaining all elements of thisNEList.
- def toIterator: Iterator[T]
Returns an
Iteratorover the elements in thisNEList.Returns an
Iteratorover the elements in thisNEList.- returns
an
Iteratorcontaining all elements of thisNEList.
- val toList: List[T]
- def toMap[K, V](implicit ev: <:<[T, (K, V)]): Map[K, V]
Converts this
NEListto a map.Converts this
NEListto a map.This method is unavailable unless the elements are members of
Tuple2, each((K, V))becoming a key-value pair in the map. Duplicate keys will be overwritten by later keys.- returns
a map of type
immutable.Map[K, V]containing all key/value pairs of type(K, V)of thisNEList.
- def toSeq: Seq[T]
Converts this
NEListto an immutableIndexedSeq.Converts this
NEListto an immutableIndexedSeq.- returns
an immutable
IndexedSeqcontaining all elements of thisNEList.
- def toSet[U >: T]: Set[U]
Converts this
NEListto a set.Converts this
NEListto a set.- returns
a set containing all elements of this
NEList.
- def toString(): String
Returns a string representation of this
NEList.Returns a string representation of this
NEList.- returns
the string
"NEList"followed by the result of invokingtoStringon thisNEList's elements, surrounded by parentheses.
- Definition Classes
- NEList → Any
- def toVector: Vector[T]
Converts this
NEListto aVector.Converts this
NEListto aVector.- returns
a
Vectorcontaining all elements of thisNEList.
- def transpose[U](implicit ev: <:<[T, NEList[U]]): NEList[NEList[U]]
- def union[U >: T](that: Seq[U]): NEList[U]
Produces a new
NEListthat contains all elements of thisNEListand also all elements of a givenSeq.Produces a new
NEListthat contains all elements of thisNEListand also all elements of a givenSeq.NEListXunionysis equivalent toNEListX++ys.Another way to express this is that
NEListXunionyscomputes the order-presevring multi-set union ofNEListXandys. Thisunionmethod is hence a counter-part ofdiffandintersectthat also work on multi-sets.- that
the
Seqto add.- returns
a new
NEListthat contains all elements of thisNEListfollowed by all elements ofthatSeq.
- def union[U >: T](that: NEList[U]): NEList[U]
Produces a new
NEListthat contains all elements of thisNEListand also all elements of a givenNEList.Produces a new
NEListthat contains all elements of thisNEListand also all elements of a givenNEList.NEListXunionNEListYis equivalent toNEListX++NEListY.Another way to express this is that
NEListXunionNEListYcomputes the order-presevring multi-set union ofNEListXandNEListY. Thisunionmethod is hence a counter-part ofdiffandintersectthat also work on multi-sets.- that
the
NEListto add.- returns
a new
NEListthat contains all elements of thisNEListfollowed by all elements ofthat.
- def union[U >: T](that: Vector[U]): NEList[U]
Produces a new
NEListthat contains all elements of thisNEListand also all elements of a givenVector.Produces a new
NEListthat contains all elements of thisNEListand also all elements of a givenVector.NEListXunioneveryYis equivalent toNEListX++everyY.Another way to express this is that
NEListXunioneveryYcomputes the order-presevring multi-set union ofNEListXandeveryY. Thisunionmethod is hence a counter-part ofdiffandintersectthat also work on multi-sets.- that
the
Vectorto add.- returns
a new
NEListthat contains all elements of thisNEListfollowed by all elements ofthatVector.
- def unzip[L, R](implicit asPair: (T) => (L, R)): (NEList[L], NEList[R])
Converts this
NEListof pairs into twoNELists of the first and second half of each pair.Converts this
NEListof pairs into twoNELists of the first and second half of each pair.- L
the type of the first half of the element pairs
- R
the type of the second half of the element pairs
- asPair
an implicit conversion that asserts that the element type of this
NEListis a pair.- returns
a pair of
NELists, containing the first and second half, respectively, of each element pair of thisNEList.
- def unzip3[L, M, R](implicit asTriple: (T) => (L, M, R)): (NEList[L], NEList[M], NEList[R])
Converts this
NEListof triples into threeNELists of the first, second, and and third element of each triple.Converts this
NEListof triples into threeNELists of the first, second, and and third element of each triple.- L
the type of the first member of the element triples
- R
the type of the third member of the element triples
- asTriple
an implicit conversion that asserts that the element type of this
NEListis a triple.- returns
a triple of
NELists, containing the first, second, and third member, respectively, of each element triple of thisNEList.
- def updated[U >: T](idx: Int, elem: U): NEList[U]
A copy of this
NEListwith one single replaced element.A copy of this
NEListwith one single replaced element.- idx
the position of the replacement
- elem
the replacing element
- returns
a copy of this
NEListwith the element at positionidxreplaced byelem.
- Exceptions thrown
IndexOutOfBoundsExceptionif the passed index is greater than or equal to the length of thisNEList
- def zipAll[O, U >: T](other: Iterable[O], thisElem: U, otherElem: O): NEList[(U, O)]
Returns a
NEListformed from thisNEListand an iterable collection by combining corresponding elements in pairs.Returns a
NEListformed from thisNEListand an iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements will be used to extend the shorter collection to the length of the longer.- other
the
Iterableproviding the second half of each result pair- thisElem
the element to be used to fill up the result if this
NEListis shorter thanthatIterable.- returns
a new
NEListcontaining pairs consisting of corresponding elements of thisNEListandthat. The length of the returned collection is the maximum of the lengths of thisNEListandthat. If thisNEListis shorter thanthat,thisElemvalues are used to pad the result. Ifthatis shorter than thisNEList,thatElemvalues are used to pad the result.
- def zipWithIndex: NEList[(T, Int)]
Zips this
NEListwith its indices.Zips this
NEListwith its indices.- returns
A new
NEListcontaining pairs consisting of all elements of thisNEListpaired with their index. Indices start at 0.