|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OrderProperty
is an interface to denote a commonly used specialization of RelationalProperty
.
It encompasses all the various types of order: partial order, total order (linear order), strict order
It imposes restrictions on several methods of its parent RelationalProperty
interface. The following rules must hold for
any OrderProperty
implementation to be a valid implementation:
(isStrictOrder() = false) -> (isReflexive() = true)
isAntisymmetric() = true
isTransitive() = true
contains(Object dom, Object rng)
must be consistent with the above.
Method Summary | |
boolean |
comparable(java.lang.Object entryA,
java.lang.Object entryB)
Checks whether two values are comparable given a particular OrderProperty .
|
java.util.Comparator |
comparator()
Returns a comparator suitable for Java Collections utility classes. |
boolean |
isPartialOrder()
Checks whether a particular OrderProperty defines a partial order. |
boolean |
isStrictOrder()
Checks whether a particular OrderProperty defines a strict order. |
boolean |
isTotalOrder()
Checks whether a particular OrderProperty defines a total order. |
Methods inherited from interface cz.cuni.versatile.api.RelationalProperty |
contains, isAntisymmetric, isAsymetric, isIrreflexive, isReflexive, isSymmetric, isTransitive |
Methods inherited from interface cz.cuni.versatile.api.Property |
getLocalName, getNamespace, getSeparator, getType, getUniqueName |
Method Detail |
public java.util.Comparator comparator()
Remarks: Please note, that unless isTotalOrder() = true
, we consider
an order to be a partial order and therefore the comparator instance returned by this method may not be suitable
for usage by Java Collections framework, as it always assumes total (linear) order.
If two values are not comparable (due to partial order) the Comparator.compare()
method should return 0
(zero).
Collections
,
comparable(Object, Object)
public boolean comparable(java.lang.Object entryA, java.lang.Object entryB)
OrderProperty
.
isTotalOrder() = true
this method must always return true
entryA
- a property value to compareentryB
- a property value to compare
true if contains(entryA, entryB) or contains(entryB, entryA)
public boolean isTotalOrder()
OrderProperty
defines a total order.
true if for all x,y: comparable(x, y) = true
public boolean isPartialOrder()
OrderProperty
defines a partial order.
not isTotalOrder()
(i.e. an opposite to total order)public boolean isStrictOrder()
OrderProperty
defines a strict order.
not isReflexive()
(i.e. true
for irreflexive relations)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |