|
|||||||||
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> jpaul.DataStructs.Relation3MapRelImpl<Ta,Tb,Tc>
public class Relation3MapRelImpl<Ta,Tb,Tc>
Relation3MapRelImpl
is a simple implementation of
Relation3
, backed by a Map
from
Ta
keys to RelationTb,Tc
between
Tb
and Tc
.
Constructor Summary | |
---|---|
Relation3MapRelImpl()
Creates a Relation3MapRelImpl object using a
factory of LinkedHashMap s and a factory of
MapSetRelation s. |
|
Relation3MapRelImpl(MapFactory<Ta,Relation<Tb,Tc>> mapFact,
RelationFactory<Tb,Tc> relFact)
Creates a Relation3MapRelImpl . |
Method Summary | |
---|---|
boolean |
add(Ta a,
Tb b,
Tc c)
Adds the triple <a,b,c> to this ternary
relation. |
void |
clear()
Removes all associations from this ternary
relation. |
boolean |
contains(Ta a,
Tb b,
Tc c)
Checks the presence of the triple <a,b,c> in this ternary relation. |
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. |
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. |
java.util.Collection<Ta> |
getKeys()
Returns the elements that appear in the 1st position of at least one triple from this ternary relation. |
boolean |
remove(Ta a,
Tb b,
Tc c)
Removes the triple <a,b,c> from this ternary
relation. |
Methods inherited from class jpaul.DataStructs.Relation3 |
---|
size, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Relation3MapRelImpl(MapFactory<Ta,Relation<Tb,Tc>> mapFact, RelationFactory<Tb,Tc> relFact)
Relation3MapRelImpl
. This constructor
allows the user to indicate what map and relation
implementations he wants to use. Therefore, this constructor
is good while finely-tuning the performances of an application
using a large number of small ternary relations.
public Relation3MapRelImpl()
Relation3MapRelImpl
object using a
factory of LinkedHashMap
s and a factory of
MapSetRelation
s. This default constructor
consumes a lot of memory but should work just fine for large
and not-very-frequent ternary relations.
Method Detail |
---|
public boolean add(Ta a, Tb b, Tc c)
Relation3
this
ternary
relation.
add
in class Relation3<Ta,Tb,Tc>
public boolean remove(Ta a, Tb b, Tc c)
Relation3
this
ternary
relation.
remove
in class Relation3<Ta,Tb,Tc>
public boolean contains(Ta a, Tb b, Tc c)
Relation3
this
ternary relation.
contains
in class Relation3<Ta,Tb,Tc>
public java.util.Collection<Ta> getKeys()
Relation3
this
ternary relation.
Unmodifiable view.
getKeys
in class Relation3<Ta,Tb,Tc>
public java.util.Collection<Tb> get2ndValues(Ta a)
Relation3
this
ternary
relation and has a
in its 1st position.
Unmodifiable view.
get2ndValues
in class Relation3<Ta,Tb,Tc>
public java.util.Collection<Tc> get3rdValues(Ta a, Tb b)
Relation3
this
ternary relation.
get3rdValues
in class Relation3<Ta,Tb,Tc>
public void clear()
Relation3
this
ternary
relation.
clear
in class Relation3<Ta,Tb,Tc>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |