- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines a relationship between two integers. For example, if x equals 5 and y
equals 3, then the is-greater-than relation exists between x and y. See the
package description for more
information.
- Author:
- Ayco Holleman
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault IntRelation
converse()
Returns the converse of this relation, swapping subject and object in the relationship.boolean
exists
(int subject, int object) Determines whethersubject
relates toobject
in the manner defined by thisIntRelation
.default IntRelation
negate()
Returns the negation of thisIntRelation
.
-
Method Details
-
converse
Returns the converse of this relation, swapping subject and object in the relationship. For example, the converse of x > y is y > x (or x <= y).- Returns:
- the converse of this
IntRelation
-
negate
Returns the negation of thisIntRelation
. For example, the negation of x > y is x <= y.- Returns:
- the negation of this
IntRelation
-
exists
boolean exists(int subject, int object) Determines whethersubject
relates toobject
in the manner defined by thisIntRelation
.- Parameters:
subject
- The value to testobject
- The value to test it against- Returns:
true
if the relation exists,false
otherwise.
-