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

All Superinterfaces:
Collection<Quad<T1,T2,T3,T4>>, Iterable<Quad<T1,T2,T3,T4>>, Predicate<Object>, Predicate4<T1,T2,T3,T4>, PredicateSet<Quad<T1,T2,T3,T4>>, Set<Quad<T1,T2,T3,T4>>, SizedIterable<Quad<T1,T2,T3,T4>>

public interface Relation4<T1,T2,T3,T4>
extends PredicateSet<Quad<T1,T2,T3,T4>>, Predicate4<T1,T2,T3,T4>

A set of quads representing a quaternary 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, T4 fourth)
          Add Quad.make(first, second, third, fourth) to the set.
 boolean contains(T1 first, T2 second, T3 third, T4 fourth)
          Whether Quad.make(first, second, third, fourth) appears in the set.
 boolean containsFirst(T1 first)
          Whether a quad with the given first value appears in the set.
 boolean containsFourth(T4 fourth)
          Whether a quad with the given fourth value appears in the set.
 boolean containsSecond(T2 second)
          Whether a quad with the given second value appears in the set.
 boolean containsThird(T3 third)
          Whether a quad with the given third value appears in the set.
 Relation3<T2,T3,T4> excludeFirsts()
          The set of (second, third, fourth) triples for which there exists a (first, second, third, fourth) quad in the relation.
 Relation3<T1,T2,T3> excludeFourths()
          The set of (first, second, third) triples for which there exists a (first, second, third, fourth) quad in the relation.
 Relation3<T1,T3,T4> excludeSeconds()
          The set of (first, third, fourth) triples for which there exists a (first, second, third, fourth) quad in the relation.
 Relation3<T1,T2,T4> excludeThirds()
          The set of (first, second, fourth) triples for which there exists a (first, second, third, fourth) quad in the relation.
 Map<T1,Relation3<T2,T3,T4>> firstMap()
          A map view of the relation, mapping firsts to sets of (second, third, fourth) triples.
 Set<T1> firstSet()
          The set of firsts.
 Map<T4,Relation3<T1,T2,T3>> fourthMap()
          A map view of the relation, mapping fourths to sets of (first, second, third) triples.
 Set<T4> fourthSet()
          The set of fourths.
 Relation3<T2,T3,T4> matchFirst(T1 first)
          The set of (second, third, fourth) triples corresponding to a specific first.
 Relation3<T1,T2,T3> matchFourth(T4 fourth)
          The set of (first, second, third) triples corresponding to a specific fourth.
 Relation3<T1,T3,T4> matchSecond(T2 second)
          The set of (first, third, fourth) triples corresponding to a specific second.
 Relation3<T1,T2,T4> matchThird(T3 third)
          The set of (first, second, fourth) triples corresponding to a specific third.
 boolean remove(T1 first, T2 second, T3 third, T4 fourth)
          Remove Quad.make(first, second, third, fourth) from the set.
 Map<T2,Relation3<T1,T3,T4>> secondMap()
          A map view of the relation, mapping seconds to sets of (first, third, fourth) triples.
 Set<T2> secondSet()
          The set of seconds.
 Map<T3,Relation3<T1,T2,T4>> thirdMap()
          A map view of the relation, mapping thirds to sets of (first, second, fourth) triples.
 Set<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,
                 T4 fourth)
Whether Quad.make(first, second, third, fourth) appears in the set.

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

add

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


remove

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


firstSet

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


firstMap

Map<T1,Relation3<T2,T3,T4>> firstMap()
A map view of the relation, mapping firsts to sets of (second, third, fourth) triples. 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 quad with the given first value appears in the set.


matchFirst

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


excludeFirsts

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


secondSet

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


secondMap

Map<T2,Relation3<T1,T3,T4>> secondMap()
A map view of the relation, mapping seconds to sets of (first, third, fourth) triples. 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 quad with the given second value appears in the set.


matchSecond

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


excludeSeconds

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


thirdSet

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


thirdMap

Map<T3,Relation3<T1,T2,T4>> thirdMap()
A map view of the relation, mapping thirds to sets of (first, second, fourth) triples. 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 quad with the given third value appears in the set.


matchThird

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


excludeThirds

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


fourthSet

Set<T4> fourthSet()
The set of fourths. Need not allow mutation, but must reflect subsequent changes.


fourthMap

Map<T4,Relation3<T1,T2,T3>> fourthMap()
A map view of the relation, mapping fourths to sets of (first, second, third) triples. 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.


containsFourth

boolean containsFourth(T4 fourth)
Whether a quad with the given fourth value appears in the set.


matchFourth

Relation3<T1,T2,T3> matchFourth(T4 fourth)
The set of (first, second, third) triples corresponding to a specific fourth. Need not allow mutation, but must reflect subsequent changes.


excludeFourths

Relation3<T1,T2,T3> excludeFourths()
The set of (first, second, third) triples for which there exists a (first, second, third, fourth) quad in the relation. Need not allow mutation, but must reflect subsequent changes.