Interface IBinaryNaturalRelation
- All Superinterfaces:
Iterable<IntPair>, VerboseAction
- All Known Implementing Classes:
BasicNaturalRelation
a relation R(x,y) where x >= 0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int x, int y) Add (x,y) to the relationbooleananyRelated(int x) booleancontains(int x, int y) getRelated(int x) intgetRelatedCount(int x) intvoidremove(int x, int y) voidremoveAll(int x) Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface VerboseAction
performVerboseAction
-
Method Details
-
add
boolean add(int x, int y) Add (x,y) to the relation- Returns:
- true iff the relation changes as a result of this call.
-
getRelated
- Returns:
- IntSet of y s.t. R(x,y) or null if none.
-
getRelatedCount
int getRelatedCount(int x) - Returns:
- number of y s.t. R(x,y)
-
anyRelated
boolean anyRelated(int x) - Returns:
- true iff there exists pair (x,y) for some y
-
remove
void remove(int x, int y) -
removeAll
void removeAll(int x) -
contains
boolean contains(int x, int y) - Returns:
- true iff (x,y) \in R
-
maxKeyValue
int maxKeyValue()
-