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)))
Like groupBy but returns the count of each key instead of the actual values
A combination of map + find that returns the first Some that is found after applying the map operation.
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.
Same as mkString except if the TraversableOnce is empty then an empty string is returned instead of the start and end params.
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.
Like .toMap but creates an immutable.HashMap
Like .toSet but creates an immutable.HashSet
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)
Like .groupBy but gives you an immutable.HashMap[K, IndexedSeq[A]]
Like .groupBy but gives you an immutable.HashMap[K, IndexedSeq[A]]
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)
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)
Like .toSet but returns a scala.collection.immutable.SortedSet instead
Same as .toHashMap but ensures there are no duplicate keys
Alias of uniqueGroupBy
Same as toUniqueHashMap but allows you to specify a transform function for the key
Same as toUniqueHashMap but allows you to specify transform functions for the key and value
Like .toHashSet but makes sure there are no duplicates
Same as .toMap but ensures there are no duplicate keys
Like .toSet but makes sure there are no duplicates
Returns a Vector of this Iterable (if it's not already a Vector)
Like groupBy but only allows a single value per key