public final class BasicNaturalRelation extends Object implements IBinaryNaturalRelation, Serializable
Modifier and Type | Field and Description |
---|---|
static byte |
SIMPLE
Tokens used as enumerated types to control the representation
|
static byte |
SIMPLE_SPACE_STINGY |
static byte |
TWO_LEVEL |
Constructor and Description |
---|
BasicNaturalRelation() |
BasicNaturalRelation(byte[] implementation,
byte vectorImpl) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int x,
int y)
Add (x,y) to the relation.
|
boolean |
anyRelated(int x) |
boolean |
contains(int x,
int y) |
IntSet |
getRelated(int x) |
int |
getRelatedCount(int x) |
Iterator<IntPair> |
iterator() |
int |
maxKeyValue() |
void |
performVerboseAction()
optional method used for performance debugging
|
void |
remove(int x,
int y) |
void |
removeAll(int x) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final byte SIMPLE
public static final byte TWO_LEVEL
public static final byte SIMPLE_SPACE_STINGY
public BasicNaturalRelation(byte[] implementation, byte vectorImpl) throws IllegalArgumentException
implementation
- a set of codes that represent how the first n IntVectors should be implemented.vectorImpl
- a code that indicates how to represent the delegateStore.
For example implementation = {SIMPLE_INT_VECTOR,TWO_LEVEL_INT_VECTOR,TWO_LEVEL_INT_VECTOR} will result in an
implementation where the first 3 y's associated with each x are represented in IntVectors. The IntVector for the first
y will be implemented with a SimpleIntVector, and the 2nd and 3rd are implemented with TwoLevelIntVectorIllegalArgumentException
- if implementation is nullIllegalArgumentException
- if implementation.length == 0public BasicNaturalRelation()
public boolean add(int x, int y) throws IllegalArgumentException
add
in interface IBinaryNaturalRelation
IllegalArgumentException
public boolean anyRelated(int x)
anyRelated
in interface IBinaryNaturalRelation
x
- public IntSet getRelated(int x)
getRelated
in interface IBinaryNaturalRelation
public int getRelatedCount(int x) throws IllegalArgumentException
getRelatedCount
in interface IBinaryNaturalRelation
IllegalArgumentException
public void remove(int x, int y)
remove
in interface IBinaryNaturalRelation
public void removeAll(int x)
removeAll
in interface IBinaryNaturalRelation
public void performVerboseAction()
VerboseAction
performVerboseAction
in interface VerboseAction
public boolean contains(int x, int y)
contains
in interface IBinaryNaturalRelation
public int maxKeyValue()
maxKeyValue
in interface IBinaryNaturalRelation