scala.math

trait PartialOrdering

[source: scala/math/PartialOrdering.scala]

trait PartialOrdering[T]
extends Equiv[T] with AnyRef

A trait for representing partial orderings. It is important to distinguish between a type that has a partial order and a representation of partial ordering on some type. This trait is for representing the latter.

A partial ordering is a binary relation on a type T that is also an equivalence relation on values of type T. This relation is exposed as the lteq method of the PartialOrdering trait. This relation must be:

Author
Geoffrey Washburn
Version
1.0, 2008-04-0-3
Since
2.7
Direct Known Subclasses:
Ordering

Method Summary
def equiv (x : T, y : T) : Boolean
Returns true iff x is equivalent to y in the ordering.
def gt (x : T, y : T) : Boolean
Returns true iff y comes before x in the ordering and is not the same as x.
def gteq (x : T, y : T) : Boolean
Returns true iff y comes before x in the ordering.
def lt (x : T, y : T) : Boolean
Returns true iff x comes before y in the ordering and is not the same as y.
abstract def lteq (x : T, y : T) : Boolean
Returns true iff x comes before y in the ordering.
def reverse : PartialOrdering[T]
abstract def tryCompare (x : T, y : T) : Option[Int]
Result of comparing x with operand y. Returns None if operands are not comparable. If operands are comparable, returns Some(r) where r < 0 iff x < y r == 0 iff x == y r > 0 iff x > y
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 tryCompare(x : T, y : T) : Option[Int]
Result of comparing x with operand y. Returns None if operands are not comparable. If operands are comparable, returns Some(r) where r < 0 iff x < y r == 0 iff x == y r > 0 iff x > y

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

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

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

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

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

def reverse : PartialOrdering[T]