c

fm.common.rich

RichIterableOnce

final class RichIterableOnce[A] extends AnyVal

Source
RichIterableOnce.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RichIterableOnce
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RichIterableOnce(self: IterableOnce[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def collapseBy[K](f: (A) => K): IndexedSeq[(K, Seq[A])]

    Collapse records that are next to each other by a key

    Collapse records that are next to each other by a key

    Example:

    This groups evens and odds together:

    Vector(2,4,6,1,3,2,5,7).collapseBy{ _ % 2 == 0 }
    // res1: IndexedSeq[(Boolean, Seq[Int])] = Vector((true,Vector(2, 4, 6)), (false,Vector(1, 3)), (true,Vector(2)), (false,Vector(5, 7)))
  6. def countBy[K](f: (A) => K): Map[K, Int]

    Like groupBy but returns the count of each key instead of the actual values

  7. def distinctUsing[B](f: (A) => B): IndexedSeq[A]
  8. def findMapped[B](f: (A) => Option[B]): Option[B]

    A combination of map + find that returns the first Some that is found after applying the map operation.

  9. def findMappedFuture[B](f: (A) => Future[Option[B]])(implicit ec: ExecutionContext): Future[Option[B]]

    Like findMapped except works with Futures.

    Like findMapped except works with Futures. Executes the futures one at a time until one with a defined result is found.

  10. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def maxOption[B >: A](implicit cmp: Ordering[B]): Option[A]
  13. def minOption[B >: A](implicit cmp: Ordering[B]): Option[A]
  14. def mkStringOrBlank(start: String, sep: String, end: String): String

    Same as mkString except if the IterableOnce is empty then an empty string is returned instead of the start and end params.

  15. val self: IterableOnce[A]
  16. def sortByCached[K](f: (A) => K)(implicit ord: Ordering[K]): IndexedSeq[A]

    Like the normal sortBy but will cache the result of calling f on each element (i.e.

    Like the normal sortBy but will cache the result of calling f on each element (i.e. f is only called once for each element). This is useful when f is an expensive function and not just a single field access on the element.

    If this is call on something that isn't already an IndexedSeq then it will be automatically converted before sorting.

  17. def toHashMap[K, V](implicit ev: <:<[A, (K, V)]): HashMap[K, V]

    Like .toMap but creates an immutable.HashMap

  18. def toHashSet: HashSet[A]

    Like .toSet but creates an immutable.HashSet

  19. def toMultiValuedLowerAlphaNumericMap[V](implicit ev: <:<[A, (String, V)]): HashMap[String, Vector[V]]
  20. def toMultiValuedMap[K, V](implicit ev: <:<[A, (K, V)]): HashMap[K, Vector[V]]

    Like .toHashMap except allows multiple values per key

    Like .toHashMap except allows multiple values per key

    TODO: Change this to IndexedSeq so we can switch to ImmutableArray (if we want to)

  21. def toMultiValuedMapUsing[K](toKey: (A) => K): HashMap[K, IndexedSeq[A]]

    Like .groupBy but gives you an immutable.HashMap[K, IndexedSeq[A]]

  22. def toMultiValuedMapUsingKeys[K](toKeys: (A) => IterableOnce[K]): HashMap[K, IndexedSeq[A]]

    Like .groupBy but gives you an immutable.HashMap[K, IndexedSeq[A]]

  23. def toMultiValuedMapWithKeyTransform[K, V, K2](keyTransform: (K) => K2)(implicit ev: <:<[A, (K, V)]): HashMap[K2, Vector[V]]

    Same as toMultiValuedMap but allows you to specify a transform function for the key

    Same as toMultiValuedMap but allows you to specify a transform function for the key

    TODO: Change this to IndexedSeq so we can switch to ImmutableArray (if we want to)

  24. def toMultiValuedMapWithTransforms[K, V, K2, V2](keyTransform: (K) => K2, valueTransform: (V) => V2)(implicit ev: <:<[A, (K, V)]): HashMap[K2, Vector[V2]]

    Same as toMultiValuedMap but allows you to specify transform functions for the key and value

    Same as toMultiValuedMap but allows you to specify transform functions for the key and value

    TODO: Change this to IndexedSeq so we can switch to ImmutableArray (if we want to)

  25. def toMultiValuedURLNameMap[V](implicit ev: <:<[A, (String, V)]): HashMap[String, Vector[V]]
  26. def toSortedSet(implicit ord: Ordering[A]): SortedSet[A]

    Like .toSet but returns a scala.collection.immutable.SortedSet instead

  27. def toString(): String
    Definition Classes
    Any
  28. def toUniqueHashMap[K, V](implicit ev: <:<[A, (K, V)]): HashMap[K, V]

    Same as .toHashMap but ensures there are no duplicate keys

  29. def toUniqueHashMapUsing[K](f: (A) => K): HashMap[K, A]

    Alias of uniqueGroupBy

  30. def toUniqueHashMapWithKeyTransform[K, V, K2](keyTransform: (K) => K2)(implicit ev: <:<[A, (K, V)]): HashMap[K2, V]

    Same as toUniqueHashMap but allows you to specify a transform function for the key

  31. def toUniqueHashMapWithTransforms[K, V, K2, V2](keyTransform: (K) => K2, valueTransform: (V) => V2)(implicit ev: <:<[A, (K, V)]): HashMap[K2, V2]

    Same as toUniqueHashMap but allows you to specify transform functions for the key and value

  32. def toUniqueHashSet: HashSet[A]

    Like .toHashSet but makes sure there are no duplicates

  33. def toUniqueLowerAlphaNumericMap[V](implicit ev: <:<[A, (String, V)]): HashMap[String, V]
  34. def toUniqueMap[K, V](implicit ev: <:<[A, (K, V)]): HashMap[K, V]

    Same as .toMap but ensures there are no duplicate keys

  35. def toUniqueSet: Set[A]

    Like .toSet but makes sure there are no duplicates

  36. def toUniqueURLNameMap[V](implicit ev: <:<[A, (String, V)]): HashMap[String, V]
  37. def toVector: Vector[A]

    Returns a Vector of this Iterable (if it's not already a Vector)

  38. def uniqueGroupBy[K](f: (A) => K): HashMap[K, A]

    Like groupBy but only allows a single value per key

Inherited from AnyVal

Inherited from Any

Ungrouped