cgta.oscala.extensions

SeqExtensions

final class SeqExtensions[A] extends AnyVal

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SeqExtensions
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SeqExtensions(xs: Seq[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 getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  6. def getOpt(i: Int): Option[A]

  7. def intersperse[B >: A](start: ⇒ Option[B] = None, sep: ⇒ Option[B] = None, end: ⇒ Option[B] = None): Vector[B]

    Creates a new Sequence with start before the first element, sep between them, and end after the last element

    Creates a new Sequence with start before the first element, sep between them, and end after the last element

    B
    start

    Item to place before the first element

    sep
    end
    returns

  8. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  9. def maxByOpt[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): Option[A]

  10. def maxOpt[B >: A](implicit cmp: Ordering[B]): Option[A]

  11. def minByOpt[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): Option[A]

  12. def minOpt[B >: A](implicit cmp: Ordering[B]): Option[A]

  13. def removeDuplicatesBy[B](f: (A) ⇒ B)(r: (A, A) ⇒ A): Seq[A]

    Removes duplicates from a sequence using a f to provide keys used for determining equality of elements When a duplicate is removed a reducer function r is used to determine what to keep.

    Removes duplicates from a sequence using a f to provide keys used for determining equality of elements When a duplicate is removed a reducer function r is used to determine what to keep.

    Warning this class does NOT preserve ordering of the elements!

    Example (Not That Order was not preserved)

    xs = List(1->2, 1->3, 1->2, 2->1, 3->4, 4->1, 4-> -1, 5->1) ys = RicherSeq(xs).removeDuplicatesBy(_._1)(List(_,_).maxBy(_._2)) ys == Vector((5,1), (1,3), (2,1), (3,4), (4,1))

    B
    f

    Function that turns an element into some other type B used for equality checks

    r

    Tie breaker function that chooses which to keep

    returns

  14. def takeUntil(end: (A) ⇒ Boolean): Seq[A]

    Starts at head and gets all elements until the end function returns true

    Starts at head and gets all elements until the end function returns true

    end

    function to determine last element to include in the result

  15. def toOSeq: IndexedSeq[A]

  16. def toString(): String

    Definition Classes
    Any
  17. val xs: Seq[A]

Inherited from AnyVal

Inherited from Any

Ungrouped