Class

fm.common.rich

RichTraversableOnce

Related Doc: package rich

Permalink

final class RichTraversableOnce[A] extends AnyVal

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RichTraversableOnce
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichTraversableOnce(self: TraversableOnce[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def collapseBy[K](f: (A) ⇒ K): IndexedSeq[(K, Seq[A])]

    Permalink

    Collapse records that are next to each other by a key

    Collapse records that are next to each other by a key

    e.g.: This groups evens and odds together:

    scala> 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]

    Permalink

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

  7. def distinctUsing[B](f: (A) ⇒ B)(implicit ord: Ordering[B]): IndexedSeq[A]

    Permalink
  8. def findMapped[B](f: (A) ⇒ Option[B]): Option[B]

    Permalink

    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]]

    Permalink

    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]

    Permalink
    Definition Classes
    AnyVal → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. def maxOption[B >: A](implicit cmp: Ordering[B]): Option[A]

    Permalink
  13. def minOption[B >: A](implicit cmp: Ordering[B]): Option[A]

    Permalink
  14. def mkStringOrBlank(start: String, sep: String, end: String): String

    Permalink

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

  15. val self: TraversableOnce[A]

    Permalink
  16. def sortByCached[K](f: (A) ⇒ K)(implicit ord: Ordering[K]): IndexedSeq[A]

    Permalink

    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]

    Permalink

    Like .toMap but creates an immutable.HashMap

  18. def toHashSet: HashSet[A]

    Permalink

    Like .toSet but creates an immutable.HashSet

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

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

    Permalink

    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]]

    Permalink

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

  22. def toMultiValuedMapUsingKeys[K](toKeys: (A) ⇒ TraversableOnce[K]): HashMap[K, IndexedSeq[A]]

    Permalink

    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]]

    Permalink

    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]]

    Permalink

    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]]

    Permalink
  26. def toSortedSet(implicit ord: Ordering[A]): SortedSet[A]

    Permalink

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

  27. def toString(): String

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

    Permalink

    Same as .toHashMap but ensures there are no duplicate keys

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

    Permalink

    Alias of uniqueGroupBy

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

    Permalink

    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]

    Permalink

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

  32. def toUniqueHashSet: HashSet[A]

    Permalink

    Like .toHashSet but makes sure there are no duplicates

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

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

    Permalink

    Same as .toMap but ensures there are no duplicate keys

  35. def toUniqueSet: Set[A]

    Permalink

    Like .toSet but makes sure there are no duplicates

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

    Permalink
  37. def toVector: Vector[A]

    Permalink

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

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

    Permalink

    Like groupBy but only allows a single value per key

Inherited from AnyVal

Inherited from Any

Ungrouped