Returns a negative integer iff x
comes beforey
in the ordering, returns 0 iff x
is the same in the ordering as y
, and returns a
positive number iff x
comes aftery
in the ordering.
Returns a negative integer iff x
comes beforey
in the ordering, returns 0 iff x
is the same in the ordering as y
, and returns a
positive number iff x
comes aftery
in the ordering.
Returns true
iff x
is equivalent to
y
in the ordering.
Returns true
iff x
is equivalent to
y
in the ordering.
Returns true
iff y
comes before
x
in the ordering and is not the same as x
.
Returns true
iff y
comes before
x
in the ordering and is not the same as x
.
Returns true
iff y
comes before
x
in the ordering.
Returns true
iff y
comes before
x
in the ordering.
Returns true
iff x
comes before
y
in the ordering and is not the same as y
.
Returns true
iff x
comes before
y
in the ordering and is not the same as y
.
Returns true
iff x
comes before
y
in the ordering.
Returns true
iff x
comes before
y
in the ordering.
Returns the argument which comes later in the ordering.
Returns the argument which comes later in the ordering.
Returns the argument which comes earlier in the ordering.
Returns the argument which comes earlier in the ordering.
Given a function U => T, creates Ordering[U].
Given a function U => T, creates Ordering[U].
An Ordering is defined at all x and y.
An Ordering is defined at all x and y.
A trait for representing total orderings. It is important to distinguish between a type that has a total order and a representation of total ordering on some type. This trait is for representing the latter.
A total orderingis a binary relation on a type
T
that is also an equivalence relation and partial ordering on values of typeT
. This relation is exposed as thecompare
method of theOrdering
trait. This relation must be:compare(x, x) == 0
, for anyx
of typeT
.compare(x, y) == z
andcompare(y, x) == w
thenmath.signum(z) == -math.signum(w)
, for anyx
andy
of typeT
andz
andw
of typeInt
.compare(x, y) == z
andcompare(y, w) == v
andmath.signum(z) >= 0
andmath.signum(v) >= 0
thencompare(x, w) == u
andmath.signum(z + v) == math.signum(u)
, for anyx
,y
, andw
of typeT
andz
,v
, andu
of typeInt
.version
0.9.5, 2008-04-15
since
2.7