ral.lang
Interface SimpleRelationship<FROM,TO>

All Superinterfaces:
MultiRelationship<FROM,TO,FixedPair<FROM,TO>>, UniMultiRelationship<FROM,TO,FixedPair<FROM,TO>>
All Known Implementing Classes:
SimpleHashArrayRel, SimpleHashRel, SimpleReflexiveHashArrayRel, SimpleReflexiveHashRel

public interface SimpleRelationship<FROM,TO>
extends MultiRelationship<FROM,TO,FixedPair<FROM,TO>>

A simple relationship describes the case where no information is associated with each pair. In this case, the FixedPair is used to represent Pair objects and this * is maintained internally inside a given implementation --- enabling some optimisations * that would otherwise be impossible.


Method Summary
 boolean add(FROM f, TO t)
           
 java.util.Collection<TO> from(FROM f)
          Returns all objects t, such that there exists a pair
 boolean remove(FROM f, TO t)
          Removes a pair instance
 java.util.Collection<FROM> to(TO t)
          Returns all objects f, such that there exists a pair
 
Methods inherited from interface ral.lang.MultiRelationship
clearTo, copyTo, toPairs
 
Methods inherited from interface ral.lang.UniMultiRelationship
add, clearFrom, copyFrom, fromPairs, get, remove
 

Method Detail

add

boolean add(FROM f,
            TO t)

remove

boolean remove(FROM f,
               TO t)
Description copied from interface: UniMultiRelationship
Removes a pair instance

Specified by:
remove in interface UniMultiRelationship<FROM,TO,FixedPair<FROM,TO>>

to

java.util.Collection<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,FixedPair<FROM,TO>>

from

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

Specified by:
from in interface UniMultiRelationship<FROM,TO,FixedPair<FROM,TO>>