|
Scala Library
|
|
scala/Ordering.scala]
trait
Ordering[T]
extends PartialOrdering[T]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:
compare(x, x) == 0, for any x of
type T.compare(x, y) == z and compare(y, x) == w
then Math.signum(z) == -Math.signum(w), for any x and y of
type T and z and w of type Int.compare(x, y) == z and compare(y, w) == v
and Math.signum(z) >= 0 and Math.signum(v) >= 0 then
compare(x, w) == u and Math.signum(z + v) == Math.signum(u),
for any x, y,
and w of type T and z, v, and u
of type Int.| 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 |
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.true iff x comes before
y in the ordering.true iff y comes before
x in the ordering.true iff x comes before
y in the ordering and is not the same as y.true iff y comes before
x in the ordering and is not the same as x.true iff x is equivalent to
y in the ordering.|
Scala Library
|
|