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
, exposed as the lteq
method of this trait. This relation must be:
- reflexive: lteq(x, x) == true
, for any x
of type T
. - anti-symmetric: if lteq(x, y) == true
and lteq(y, x) == true
then equiv(x, y) == true
, for any x
and y
of type T
. - transitive: if lteq(x, y) == true
and lteq(y, z) == true
then lteq(x, z) == true
, for any x
, y
, and z
of type T
.
Additionally, a partial ordering induces an equivalence relation on a type T
: x
and y
of type T
are equivalent if and only if lteq(x, y) && lteq(y, x) == true
. This equivalence relation is exposed as the equiv
method, inherited from the Equiv trait.
Attributes
- Companion
- object
- Source
- PartialOrdering.scala
- Graph
-
- Supertypes
- Known subtypes
-
trait Ordering[T]object DeadlineIsOrderedobject DurationIsOrderedobject FiniteDurationIsOrderedtrait Numeric[T]trait Fractional[T]trait BigDecimalIsFractionalobject BigDecimalIsFractionaltrait DoubleIsFractionalobject DoubleIsFractionaltrait FloatIsFractionalobject FloatIsFractionaltrait Integral[T]trait BigDecimalAsIfIntegralobject BigDecimalAsIfIntegraltrait BigIntIsIntegralobject BigIntIsIntegraltrait ByteIsIntegralobject ByteIsIntegraltrait CharIsIntegralobject CharIsIntegraltrait IntIsIntegralobject IntIsIntegraltrait LongIsIntegralobject LongIsIntegraltrait ShortIsIntegralobject ShortIsIntegraltrait BigDecimalIsConflictedtrait BigDecimalOrderingobject BigDecimaltrait BigIntOrderingobject BigInttrait BooleanOrderingobject Booleantrait ByteOrderingobject Bytetrait CachedReverse[T]object Inttrait CharOrderingobject Chartrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedDoubleOrderingobject TotalOrderingtrait IeeeOrderingobject IeeeOrderingtrait TotalOrderingobject DeprecatedFloatOrderingobject TotalOrderingtrait IntOrderingtrait LongOrderingobject Longtrait OptionOrdering[T]trait ShortOrderingobject Shorttrait StringOrderingobject Stringtrait SymbolOrderingobject Symboltrait UnitOrderingobject UnitShow all
- Self type
Members list
Value members
Abstract methods
Returns true
iff x
comes before y
in the ordering.
Result of comparing x
with operand y
.
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
Attributes
- Source
- PartialOrdering.scala
Concrete methods
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
.
Attributes
- Source
- PartialOrdering.scala
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
.
Attributes
- Source
- PartialOrdering.scala
Attributes
- Source
- PartialOrdering.scala