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

All Superinterfaces:
UniMultiRelationship<FROM,TO,T>
All Known Subinterfaces:
One2ManyRelationship<FROM,TO,T>, ReflexiveRelationship<FROM,T>, Relationship<FROM,TO,T>, SimpleRelationship<FROM,TO>, TreeRelationship<FROM,T>, UndirectedRelationship<FROM,T>
All Known Implementing Classes:
HashRel, One2ManyHashRel, ReflexiveHashRel, SimpleHashArrayRel, SimpleHashRel, SimpleReflexiveHashArrayRel, SimpleReflexiveHashRel, TreeHashRel

public interface MultiRelationship<FROM,TO,T extends Pair<FROM,TO>>
extends UniMultiRelationship<FROM,TO,T>

A multi relationship describes a bag of pairs between objects of the correspond FROM and TO types. Thus, it differs from Relationship as the pair can appear multiple times. This concept corresponds to a multigraph from graph theory.


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

Method Detail

clearTo

void clearTo(TO t)
Clears all pairs with t in the TO position


copyTo

void copyTo(TO f,
            TO t)
Copies all pairs with f in the TO position, where the new pairs have t in the TO position instead. Note, this operation clones the underlying Pair instances.


toPairs

java.util.Collection<T> toPairs(TO t)
Returns all pairs with t in the TO position


to

java.util.Collection<FROM> to(TO t)
Returns all objects f, such that there exists a pair