scala

trait Ordering

[source: scala/Ordering.scala]

trait Ordering[T]
extends PartialOrdering[T]
A trait for representing total orderings. It is important to distinguish between a type that has a total order and a represnetation of total ordering on some type. This trait is for representing the latter. A total ordering is a binary relation on a type T that is also an equivalence relation and partial ordering on values of type T. This relation is exposed as the compare method of the Ordering trait. This relation must be:
Author
Geoffrey Washburn
Version
0.9.5, 2008-04-15
Method Summary
abstract def compare (x : T, y : T) : Int
Returns a negative integer iff x comes before y in the ordering, returns 0 iff x is the same in the ordering as y, and returns a positive number iff x comes after y in the ordering.
override def equiv (x : T, y : T) : Boolean
Returns true iff x is equivalent to y in the ordering.
override def gt (x : T, y : T) : Boolean
Returns true iff y comes before x in the ordering and is not the same as x.
override def gteq (x : T, y : T) : Boolean
Returns true iff y comes before x in the ordering.
override def lt (x : T, y : T) : Boolean
Returns true iff x comes before y in the ordering and is not the same as y.
override def lteq (x : T, y : T) : Boolean
Returns true iff x comes before y in the ordering.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def compare(x : T, y : T) : Int
Returns a negative integer iff x comes before y in the ordering, returns 0 iff x is the same in the ordering as y, and returns a positive number iff x comes after y in the ordering.

override def lteq(x : T, y : T) : Boolean
Returns true iff x comes before y in the ordering.
Overrides
PartialOrdering.lteq

override def gteq(x : T, y : T) : Boolean
Returns true iff y comes before x in the ordering.
Overrides
PartialOrdering.gteq

override def lt(x : T, y : T) : Boolean
Returns true iff x comes before y in the ordering and is not the same as y.
Overrides
PartialOrdering.lt

override def gt(x : T, y : T) : Boolean
Returns true iff y comes before x in the ordering and is not the same as x.
Overrides
PartialOrdering.gt

override def equiv(x : T, y : T) : Boolean
Returns true iff x is equivalent to y in the ordering.
Overrides
PartialOrdering.equiv