ral.lang
Interface Relationship<FROM,TO,T extends Pair<FROM,TO>>

All Superinterfaces:
MultiRelationship<FROM,TO,T>, UniMultiRelationship<FROM,TO,T>, UniRelationship<FROM,TO,T>
All Known Subinterfaces:
One2ManyRelationship<FROM,TO,T>, TreeRelationship<FROM,T>
All Known Implementing Classes:
HashRel, One2ManyHashRel, ReflexiveHashRel, TreeHashRel

public interface Relationship<FROM,TO,T extends Pair<FROM,TO>>
extends UniRelationship<FROM,TO,T>, MultiRelationship<FROM,TO,T>

A Relationship describes a set of pairs between objects of the correspond FROM and TO types. Thus, for any two objects a and b, the pair can appear at most once, although the pair may also exist. Since the FROM and TO types may be unrelated, this concept does not necessarily describe a reflexive relation (i.e. a directed graph).


Method Summary
 java.util.Set<TO> from(FROM t)
          Returns all objects t, such that there exists a pair
 java.util.Set<T> fromPairs(FROM t)
          Returns all pairs with f in the FROM position
 java.util.Set<FROM> to(TO t)
          Returns all objects f, such that there exists a pair
 java.util.Set<T> toPairs(TO t)
          Returns all pairs with t in the TO position
 
Methods inherited from interface ral.lang.UniMultiRelationship
add, clearFrom, copyFrom, get, remove, remove
 
Methods inherited from interface ral.lang.MultiRelationship
clearTo, copyTo
 
Methods inherited from interface ral.lang.UniMultiRelationship
add, clearFrom, copyFrom, get, remove, remove
 

Method Detail

toPairs

java.util.Set<T> toPairs(TO t)
Description copied from interface: MultiRelationship
Returns all pairs with t in the TO position

Specified by:
toPairs in interface MultiRelationship<FROM,TO,T extends Pair<FROM,TO>>

fromPairs

java.util.Set<T> fromPairs(FROM t)
Description copied from interface: UniMultiRelationship
Returns all pairs with f in the FROM position

Specified by:
fromPairs in interface UniMultiRelationship<FROM,TO,T extends Pair<FROM,TO>>
Specified by:
fromPairs in interface UniRelationship<FROM,TO,T extends Pair<FROM,TO>>

to

java.util.Set<FROM> to(TO t)
Description copied from interface: MultiRelationship
Returns all objects f, such that there exists a pair

Specified by:
to in interface MultiRelationship<FROM,TO,T extends Pair<FROM,TO>>

from

java.util.Set<TO> from(FROM t)
Description copied from interface: UniMultiRelationship
Returns all objects t, such that there exists a pair

Specified by:
from in interface UniMultiRelationship<FROM,TO,T extends Pair<FROM,TO>>
Specified by:
from in interface UniRelationship<FROM,TO,T extends Pair<FROM,TO>>