com.github.kschuetz

compoundsort

package compoundsort

Created by kes on 2/1/14.

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

Type Members

  1. class OrderBy[A] extends AnyRef

Value Members

  1. def ascending[B](implicit ordering: Ordering[B]): (B, B) ⇒ Int

  2. implicit def defaultTiebreaker[A]: OrderBy[A]

  3. def descending[B](implicit ordering: Ordering[B]): (B, B) ⇒ Int

  4. implicit def fn2OrderBy[A](fn: (A, A) ⇒ Boolean): OrderBy[A]

  5. def leftFirst[A](a: A, b: A): Boolean

    A comparator which always instructs the caller to order the left argument first.

    A comparator which always instructs the caller to order the left argument first.

    Can be used to terminate a chain of compare/compareOptions, as it does not require a tiebreaker function.

    A

    The type of the item in the collection that is ultimately being sorted.

    a

    The first item to be compared.

    b

    The second item to be compared.

    returns

    Always returns true.

  6. def leftIf[B](compareFeatures: (B, B) ⇒ Boolean): (B, B) ⇒ Int

  7. def orderBy[A](compare: (A, A) ⇒ Int)(implicit andThenBy: OrderBy[A]): (A, A) ⇒ Boolean

    Returns a comparator function that orders items using a provided comparator that passes the decision to the another comparator in the case of a tie.

    Returns a comparator function that orders items using a provided comparator that passes the decision to the another comparator in the case of a tie.

    A

    The type of the item in the collection that is ultimately being sorted.

    compare

    A function to compare the order of two features. Value returned indicates order: negative for left first, positive for right first, zero for tie.

    andThenBy

    The next comparison to try if the comparison results in a tie.

    returns

    A function that can be used as an argument to the sortWith method of a collection, or as the comparator in other functions in the compoundsort library.

  8. implicit def orderBy2Fn[A](orderBy: OrderBy[A]): (A, A) ⇒ Boolean

  9. def orderByFeature[A, B](getFeature: (A) ⇒ B)(compareFeatures: (B, B) ⇒ Int)(implicit andThenBy: OrderBy[A]): (A, A) ⇒ Boolean

    Returns a comparator function that orders items by first extracting a feature from each item, and then comparing this feature between items.

    Returns a comparator function that orders items by first extracting a feature from each item, and then comparing this feature between items.

    A

    The type of the item in the collection that is ultimately being sorted.

    B

    The type of the features to be extracted from the collection item.

    getFeature

    A function that extracts a feature from an item. The value that is returned from this function is what will be compared between two elements in the collection.

    compareFeatures

    A function to compare the order of two features. Value returned indicates order: negative for left first, positive for right first, zero for tie.

    andThenBy

    The next comparison to try if the comparison results in a tie.

    returns

    A function that can be used as an argument to the sortWith method of a collection, or as the comparator in other functions in the compoundsort library.

  10. def orderByFeatureNullsFirst[A, B](getFeature: (A) ⇒ Option[B])(compareFeatures: (B, B) ⇒ Int)(implicit andThenBy: OrderBy[A]): (A, A) ⇒ Boolean

    Returns a comparator function that orders items where the feature extraction fails (i.

    Returns a comparator function that orders items where the feature extraction fails (i.e. returns None) before those where the extraction succeeds.

    For those where the extraction succeeds, the items are compared by the function provided in the compareFeatures parameter.

    A

    The type of the item in the collection that is ultimately being sorted.

    B

    The type of the feature that may be extracted from the collection item.

    getFeature

    A function that (maybe) extracts a feature from an item. The value that is returned from this function is what will be compared between two elements in the collection.

    compareFeatures

    A function to compare the order of two features. Value returned indicates order: negative for left first, positive for right first, zero for tie.

    andThenBy

    The next comparison to try if the comparison results in a tie.

    returns

    A function that can be used as an argument to the sortWith method of a collection, or as the comparator in other functions in the compoundsort library.

  11. def orderByFeatureNullsLast[A, B](getFeature: (A) ⇒ Option[B])(compareFeatures: (B, B) ⇒ Int)(implicit andThenBy: OrderBy[A]): (A, A) ⇒ Boolean

    Returns a comparator function that orders items where the feature extraction fails (i.

    Returns a comparator function that orders items where the feature extraction fails (i.e. returns None) after those where the extraction succeeds.

    For those where the extraction succeeds, the items are compared by the function provided in the compareFeatures parameter.

    A

    The type of the item in the collection that is ultimately being sorted.

    B

    The type of the feature that may be extracted from the collection item.

    getFeature

    A function that (maybe) extracts a feature from an item. The value that is returned from this function is what will be compared between two elements in the collection.

    compareFeatures

    A function to compare the order of two features. Value returned indicates order: negative for left first, positive for right first, zero for tie.

    andThenBy

    The next comparison to try if the comparison results in a tie.

    returns

    A function that can be used as an argument to the sortWith method of a collection, or as the comparator in other functions in the compoundsort library.

  12. def rightFirst[A](a: A, b: A): Boolean

    A comparator which always instructs the caller to order the right argument first.

    A comparator which always instructs the caller to order the right argument first.

    Can be used to terminate a chain of compare/compareOptions, as it does not require a tiebreaker function.

    A

    The type of the item in the collection that is ultimately being sorted.

    a

    The first item to be compared.

    b

    The second item to be compared.

    returns

    Always returns false.

  13. def rightIf[B](compareFeatures: (B, B) ⇒ Boolean): (B, B) ⇒ Int

Inherited from AnyRef

Inherited from Any

Ungrouped