edu.rice.cs.plt.collect
Interface Relation3<T1,T2,T3>

All Superinterfaces:
java.util.Collection<Triple<T1,T2,T3>>, java.lang.Iterable<Triple<T1,T2,T3>>, Predicate<java.lang.Object>, Predicate3<T1,T2,T3>, PredicateSet<Triple<T1,T2,T3>>, java.util.Set<Triple<T1,T2,T3>>, SizedIterable<Triple<T1,T2,T3>>

public interface Relation3<T1,T2,T3>
extends PredicateSet<Triple<T1,T2,T3>>, Predicate3<T1,T2,T3>

A set of triples representing a ternary relation. Relations can be viewed as generalizations of maps in which keys map to sets of values, and the mapping occurs in all directions.


Method Summary
 boolean add(T1 first, T2 second, T3 third)
          Add Triple.make(first, second, third) to the set.
 boolean contains(T1 first, T2 second, T3 third)
          Whether Triple.make(first, second, third) appears in the set.
 boolean containsFirst(T1 first)
          Whether a triple with the given first value appears in the set.
 boolean containsSecond(T2 second)
          Whether a triple with the given second value appears in the set.
 boolean containsThird(T3 third)
          Whether a triple with the given third value appears in the set.
 Relation<T2,T3> excludeFirsts()
          The set of (second, third) pairs for which there exists a (first, second, third) triple in the relation.
 Relation<T1,T3> excludeSeconds()
          The set of (first, third) pairs for which there exists a (first, second, third) triple in the relation.
 Relation<T1,T2> excludeThirds()
          The set of (first, second) pairs for which there exists a (first, second, third) triple in the relation.
 LambdaMap<T1,Relation<T2,T3>> firstMap()
          A map view of the relation, mapping firsts to sets of (second, third) pairs.
 PredicateSet<T1> firstSet()
          The set of firsts.
 Relation<T2,T3> matchFirst(T1 first)
          The set of (second, third) pairs corresponding to a specific first.
 Relation<T1,T3> matchSecond(T2 second)
          The set of (first, third) pairs corresponding to a specific second.
 Relation<T1,T2> matchThird(T3 third)
          The set of (first, second) pairs corresponding to a specific third.
 boolean remove(T1 first, T2 second, T3 third)
          Remove Triple.make(first, second, third) from the set.
 LambdaMap<T2,Relation<T1,T3>> secondMap()
          A map view of the relation, mapping seconds to sets of (first, third) pairs.
 PredicateSet<T2> secondSet()
          The set of seconds.
 LambdaMap<T3,Relation<T1,T2>> thirdMap()
          A map view of the relation, mapping thirds to sets of (first, second) pairs.
 PredicateSet<T3> thirdSet()
          The set of thirds.
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface edu.rice.cs.plt.lambda.Predicate
contains
 
Methods inherited from interface edu.rice.cs.plt.iter.SizedIterable
hasFixedSize, isEmpty, isInfinite, isStatic, size, size
 

Method Detail

contains

boolean contains(T1 first,
                 T2 second,
                 T3 third)
Whether Triple.make(first, second, third) appears in the set.

Specified by:
contains in interface Predicate3<T1,T2,T3>

add

boolean add(T1 first,
            T2 second,
            T3 third)
Add Triple.make(first, second, third) to the set.


remove

boolean remove(T1 first,
               T2 second,
               T3 third)
Remove Triple.make(first, second, third) from the set.


firstSet

PredicateSet<T1> firstSet()
The set of firsts. Need not allow mutation, but must reflect subsequent changes.


firstMap

LambdaMap<T1,Relation<T2,T3>> firstMap()
A map view of the relation, mapping firsts to sets of (second, third) pairs. Only keys appearing in the relation are contained by the map -- the value sets are always non-empty. Need not allow mutation, but must reflect subsequent changes.


containsFirst

boolean containsFirst(T1 first)
Whether a triple with the given first value appears in the set.


matchFirst

Relation<T2,T3> matchFirst(T1 first)
The set of (second, third) pairs corresponding to a specific first. Need not allow mutation, but must reflect subsequent changes.


excludeFirsts

Relation<T2,T3> excludeFirsts()
The set of (second, third) pairs for which there exists a (first, second, third) triple in the relation. Need not allow mutation, but must reflect subsequent changes.


secondSet

PredicateSet<T2> secondSet()
The set of seconds. Need not allow mutation, but must reflect subsequent changes.


secondMap

LambdaMap<T2,Relation<T1,T3>> secondMap()
A map view of the relation, mapping seconds to sets of (first, third) pairs. Only keys appearing in the relation are contained by the map -- the value sets are always non-empty. Need not allow mutation, but must reflect subsequent changes.


containsSecond

boolean containsSecond(T2 second)
Whether a triple with the given second value appears in the set.


matchSecond

Relation<T1,T3> matchSecond(T2 second)
The set of (first, third) pairs corresponding to a specific second. Need not allow mutation, but must reflect subsequent changes.


excludeSeconds

Relation<T1,T3> excludeSeconds()
The set of (first, third) pairs for which there exists a (first, second, third) triple in the relation. Need not allow mutation, but must reflect subsequent changes.


thirdSet

PredicateSet<T3> thirdSet()
The set of thirds. Need not allow mutation, but must reflect subsequent changes.


thirdMap

LambdaMap<T3,Relation<T1,T2>> thirdMap()
A map view of the relation, mapping thirds to sets of (first, second) pairs. Only keys appearing in the relation are contained by the map -- the value sets are always non-empty. Need not allow mutation, but must reflect subsequent changes.


containsThird

boolean containsThird(T3 third)
Whether a triple with the given third value appears in the set.


matchThird

Relation<T1,T2> matchThird(T3 third)
The set of (first, second) pairs corresponding to a specific third. Need not allow mutation, but must reflect subsequent changes.


excludeThirds

Relation<T1,T2> excludeThirds()
The set of (first, second) pairs for which there exists a (first, second, third) triple in the relation. Need not allow mutation, but must reflect subsequent changes.