Enum Class Relation
- All Implemented Interfaces:
Serializable
,Comparable<Relation>
,Constable
Represents a relation between two objects.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Relation
get
(boolean b) static Relation
get
(double d) static Relation
get
(int i) int
boolean
isImpliedBy
(Relation other) Test whether this Relation is fulfilled if another is, i.e.boolean
isImpliedBy
(Relation... others) toString()
Returns this Relation's string representation, which is similar to "equal to" or "greater than".static Relation
Returns the enum constant of this class with the specified name.static Relation[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EQUAL
-
NOT_EQUAL
-
GREATER
-
GREATER_OR_EQUAL
-
SMALLER
-
SMALLER_OR_EQUAL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
get
-
get
-
get
-
isImpliedBy
Test whether this Relation is fulfilled if another is, i.e. if the parameter 'other' fulfilsX rel Y
, then this Relation fulfilsX rel Y
as well.- Parameters:
other
- The Relation to compare with.- Returns:
- Whether this Relation is part of the given Relation, e.g.
GREATER_OR_EQUAL.isImpliedBy(EQUAL)
returns true.
-
isImpliedBy
- Parameters:
others
- The Relations to compare with.- Returns:
- True if
isImpliedBy(Relation)
is true for any of the provided Relations.
-
toString
Returns this Relation's string representation, which is similar to "equal to" or "greater than". -
getInverse
- Returns:
- The inverse of this Relation, i.e if this Relation fulfils
X rel Y
, then the returned Relation fulfils!(X rel Y)
.
-
getSwitched
- Returns:
- The Relation which has switched arguments, i.e. if this Relation fulfils
X rel Y
, then the returned Relation fulfilsY rel X
.
-
getRelation
public int getRelation()- Returns:
- An int relating to the value of this Relation.
0 ifEQUAL
orNOT_EQUAL
1 ifGREATER
orGREATER_OR_EQUAL
-1 ifSMALLER
orSMALLER_OR_EQUAL
-