implicit final class KollFlitzSeqLike[A, Repr] extends AnyVal
Enrichment methods for sequential collections.
- Alphabetic
- By Inheritance
- KollFlitzSeqLike
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new KollFlitzSeqLike(self: SeqLike[A, Repr] with Repr)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clipAt(n: Int): A
A variant of
applythat clips the index around(0 until size).A variant of
applythat clips the index around(0 until size). Throws anIndexOutOfBoundsExceptionif the collection is empty.For example,
List(2, 3, 4, 5).clipAt(-1)gives2andList(2, 3, 4, 5).clipAt(4)gives5. -
def
decimate[To](n: Int, offset: Int = 0)(implicit cbf: CanBuildFrom[Repr, A, To]): To
The opposite of
stutter- from every subsequentnelements,n - 1will be dropped.The opposite of
stutter- from every subsequentnelements,n - 1will be dropped.For example,
(1 to 10).decimate(2)producesSeq(1, 3, 5, 7, 9).- To
the result collection type
- n
the number of times to repeat each element. If one or less, the output collection will have the same elements as the input collection.
- offset
the number of initial elements to drop. This will be clipped to the range from zero to
n - 1.- cbf
the result type builder factory
-
def
differentiate[To](implicit num: Numeric[A], cbf: CanBuildFrom[Repr, A, To]): To
Differentiates the collection by calculating the pairwise difference of the elements.
Differentiates the collection by calculating the pairwise difference of the elements.
- To
the result collection type
- num
the numerical view of the elements
- cbf
the result type builder factory
- returns
a new collection having a size one less than the input collection. the first element will be the different of the second and first element of the input sequence, etc.
-
def
foldAt(n: Int): A
A variant of
applythat folds (mirrors) the index around(0 until size).A variant of
applythat folds (mirrors) the index around(0 until size). Throws anIndexOutOfBoundsExceptionif the collection is empty.For example,
List(2, 3, 4, 5).foldAt(-1)gives3andList(2, 3, 4, 5).foldAt(4)gives4. - def foreachPair(fun: (A, A) ⇒ Unit): Unit
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
def
groupWith[To](p: (A, A) ⇒ Boolean)(implicit cbf: CanBuildFrom[Repr, A, To]): Iterator[To]
Clumps the collection into groups based on a predicate which determines if successive elements belong to the same group.
Clumps the collection into groups based on a predicate which determines if successive elements belong to the same group.
For example: {{ val x = List("a", "a", "b", "a", "b", "b") x.groupWith(_ == _).to[Vector] }}
produces
Vector(List("a", "a"), List("b"), List("a"), List("b", "b")).- To
the group type
- p
a function which is evaluated with successive pairs of the input collection. As long as the predicate holds (the function returns
true), elements are lumped together. When the predicate becomesfalse, a new group is started.- cbf
a builder factory for the group type
- returns
an iterator over the groups.
-
def
integrate[To](implicit num: Numeric[A], cbf: CanBuildFrom[Repr, A, To]): To
Integrates the collection by aggregating the elements step by step.
Integrates the collection by aggregating the elements step by step.
- To
the result collection type
- num
the numerical view of the elements
- cbf
the result type builder factory
- returns
a new collection having the same size as the input collection. the first element will be identical to the first element in the input sequence, the second element will be the sum of the first and second element of the input sequence, etc.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isSorted[B >: A](implicit ord: Ordering[B]): Boolean
- def isSortedBy[B](fun: (A) ⇒ B)(implicit ord: Ordering[B]): Boolean
- def mapPairs[B, To](fun: (A, A) ⇒ B)(implicit cbf: CanBuildFrom[Repr, B, To]): To
-
def
maxIndex[B >: A](implicit ord: Ordering[B]): Int
Returns the index of the maximum element, according to the given
Ordering.Returns the index of the maximum element, according to the given
Ordering. Yields-1if the collection is empty. -
def
maxIndexBy[B >: A](f: (A) ⇒ B)(implicit ord: Ordering[B]): Int
Returns the index of the maximum element, according to the given
Orderingand a functionfthat maps each element to a value for comparison.Returns the index of the maximum element, according to the given
Orderingand a functionfthat maps each element to a value for comparison. Yields-1if the collection is empty. -
def
minIndex[B >: A](implicit ord: Ordering[B]): Int
Returns the index of the minimum element, according to the given
Ordering.Returns the index of the minimum element, according to the given
Ordering. Yields-1if the collection is empty. -
def
minIndexBy[B >: A](f: (A) ⇒ B)(implicit ord: Ordering[B]): Int
Returns the index of the minimum element, according to the given
Orderingand a functionfthat maps each element to a value for comparison.Returns the index of the minimum element, according to the given
Orderingand a functionfthat maps each element to a value for comparison. Yields-1if the collection is empty. -
def
mirror[To](implicit cbf: CanBuildFrom[Repr, A, To]): To
Concatenates this sequence with the tail of its reversed sequence.
Concatenates this sequence with the tail of its reversed sequence.
For example,
List(1, 2, 3).mirrorproducesList(1, 2, 3, 2, 1)- To
the result collection type
- cbf
the result type builder factory
- val self: SeqLike[A, Repr] with Repr
- def sortByT[B](f: (A) ⇒ B)(implicit ord: Ordering[B]): @@[Repr, Sorted]
- def sortWithT(lt: (A, A) ⇒ Boolean): @@[Repr, Sorted]
- def sortedT[B >: A](implicit ord: Ordering[B]): @@[Repr, Sorted]
-
def
stutter[To](n: Int)(implicit cbf: CanBuildFrom[Repr, A, To]): To
Creates a new collection in which each element of the input collection is repeated
ntimes.Creates a new collection in which each element of the input collection is repeated
ntimes.For example,
List(1, 2, 3).stutter(2)producesList(1, 1, 2, 2, 3, 3).- To
the result collection type
- n
the number of times to repeat each element. If zero or less, the output collection will be empty.
- cbf
the result type builder factory
-
def
toString(): String
- Definition Classes
- Any
-
def
wrapAt(n: Int): A
A variant of
applythat wraps the index around(0 until size).A variant of
applythat wraps the index around(0 until size). Throws anIndexOutOfBoundsExceptionif the collection is empty.For example,
List(2, 3, 4, 5).wrapAt(-1)gives5andList(2, 3, 4, 5).wrapAt(4)gives2.