|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpaul.DataStructs.Relation3<Ta,Tb,Tc>
public abstract class Relation3<Ta,Tb,Tc>
Relation3
models a simple ternary relation.
Constructor Summary | |
---|---|
Relation3()
|
Method Summary | |
---|---|
abstract boolean |
add(Ta a,
Tb b,
Tc c)
Adds the triple <a,b,c> to this ternary
relation. |
abstract void |
clear()
Removes all associations from this ternary
relation. |
abstract boolean |
contains(Ta a,
Tb b,
Tc c)
Checks the presence of the triple <a,b,c> in this ternary relation. |
abstract java.util.Collection<Tb> |
get2ndValues(Ta a)
Returns the elements that appear in the 2nd position of at least one triple that appears in this ternary
relation and has a in its 1st position. |
abstract java.util.Collection<Tc> |
get3rdValues(Ta a,
Tb b)
Returns the elements that appear in the third position of at least one triple of the form <a,b,*%gt; that appears in this ternary relation. |
abstract java.util.Collection<Ta> |
getKeys()
Returns the elements that appear in the 1st position of at least one triple from this ternary relation. |
abstract boolean |
remove(Ta a,
Tb b,
Tc c)
Removes the triple <a,b,c> from this ternary
relation. |
int |
size()
Returns the number of <a,b,c> triples in this ternary relation. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Relation3()
Method Detail |
---|
public abstract boolean add(Ta a, Tb b, Tc c)
this
ternary
relation.
public abstract boolean remove(Ta a, Tb b, Tc c)
this
ternary
relation.
public abstract boolean contains(Ta a, Tb b, Tc c)
this
ternary relation.
public abstract java.util.Collection<Ta> getKeys()
this
ternary relation.
Unmodifiable view.
public abstract java.util.Collection<Tb> get2ndValues(Ta a)
this
ternary
relation and has a
in its 1st position.
Unmodifiable view.
public abstract java.util.Collection<Tc> get3rdValues(Ta a, Tb b)
this
ternary relation.
public int size()
this
ternary relation. Linear in the size of the
relation. This may be also implemented by incrementally in
O(1) by updating a size
field, but that may
complicate the code in the presence of subclassing, etc. Will
think about it if it becomes a problem.
public abstract void clear()
this
ternary
relation.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |