Scalqa Ordering is an alias to scala.Ordering. Both can be used interchangeably.
Scalqa Ordering has a new set of methods provided as extensions.
- Source
- Ordering.scala
Def
Alias for join
Alias for join
Creates a new Ordering, which will order elements based on this Ordering, and if they appear equal, on joined Ordering
- Source
- Ordering.scala
Compare elements
Compare elements
This is the only abstract method to be implemented.
Returns Int value < 0 (usually -1), if first element is less than second.
Returns Int value > 0 (usually 1), if first element is greater than second.
Returns Int value of 0, if two elements are equal.
- Source
- Ordering.scala
Join
Join
Creates a new Ordering, which will order elements based on this Ordering, and if they appear equal, on joined Ordering
- Source
- Ordering.scala
Map to type
Map to type
Maps current ordering to specified type.
Note. Mapping function takes target type value and has to convert it to current type.
val stringOrdering = Ordering[String]
val intOrdering = stringOrdering.map[Int](i => i.toString)
- Source
- Ordering.scala