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

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

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

An UniMultiRelationship relationship is a special MultiRelationship where only one direction of traversal is required. Thus, it offers potential space and time reductions as unnecessary information is not stored.


Method Summary
 boolean add(T t)
          Adds a pair to the relationship.
 void clearFrom(FROM f)
          Clears all pairs with t in the TO position
 void copyFrom(FROM f, FROM t)
          Copies all pairs with f in the FROM position, where the new pairs have t in the FROM position instead.
 java.util.Collection<TO> from(FROM f)
          Returns all objects t, such that there exists a pair
 java.util.Collection<T> fromPairs(FROM f)
          Returns all pairs with f in the FROM position
 T get(FROM f, TO t)
          Gets a Pair instance.
 boolean remove(FROM f, TO t)
          Removes a pair instance
 boolean remove(Pair<FROM,TO> t)
          Removes a pair instance
 

Method Detail

add

boolean add(T t)
Adds a pair to the relationship.


get

T get(FROM f,
      TO t)
Gets a Pair instance.


remove

boolean remove(Pair<FROM,TO> t)
Removes a pair instance


remove

boolean remove(FROM f,
               TO t)
Removes a pair instance


clearFrom

void clearFrom(FROM f)
Clears all pairs with t in the TO position


copyFrom

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


fromPairs

java.util.Collection<T> fromPairs(FROM f)
Returns all pairs with f in the FROM position


from

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