edu.rice.cs.plt.collect
Class ComplementRelation<T1,T2>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
edu.rice.cs.plt.collect.AbstractPredicateSet<Pair<T1,T2>>
edu.rice.cs.plt.collect.AbstractRelation<T1,T2>
edu.rice.cs.plt.collect.FilteredRelation<T1,T2>
edu.rice.cs.plt.collect.ComplementRelation<T1,T2>
- All Implemented Interfaces:
- PredicateSet<Pair<T1,T2>>, Relation<T1,T2>, SizedIterable<Pair<T1,T2>>, Predicate<Object>, Predicate2<T1,T2>, Composite, Serializable, Iterable<Pair<T1,T2>>, Collection<Pair<T1,T2>>, Set<Pair<T1,T2>>
public class ComplementRelation<T1,T2>
- extends FilteredRelation<T1,T2>
The complement of a relation excluded
in a domain domain
(alternatively,
domain - excluded
), constructed lazily and updated dynamically.
- See Also:
- Serialized Form
ComplementRelation
public ComplementRelation(Relation<T1,T2> domain,
Relation<? super T1,? super T2> excluded)
matchFirst
public PredicateSet<T2> matchFirst(T1 first)
- Description copied from interface:
Relation
- The set of seconds corresponding to a specific first. Need not allow mutation, but must
reflect subsequent changes.
- Specified by:
matchFirst
in interface Relation<T1,T2>
- Overrides:
matchFirst
in class FilteredRelation<T1,T2>
matchSecond
public PredicateSet<T1> matchSecond(T2 second)
- Description copied from interface:
Relation
- The set of firsts corresponding to a specific second. Need not allow mutation, but must
reflect subsequent changes.
- Specified by:
matchSecond
in interface Relation<T1,T2>
- Overrides:
matchSecond
in class FilteredRelation<T1,T2>
isInfinite
public boolean isInfinite()
- Description copied from interface:
SizedIterable
true
if the iterable is known to have infinite size. If true, an iterator over the iterable in its
current state will never return false
from hasNext()
.
- Specified by:
isInfinite
in interface SizedIterable<Pair<T1,T2>>
- Overrides:
isInfinite
in class FilteredRelation<T1,T2>
hasFixedSize
public boolean hasFixedSize()
- Description copied from interface:
SizedIterable
true
if this iterable is known to have a fixed size. This is the case if the iterable is immutable,
or if changes can only replace values, not remove or add them. An infinite iterable may be fixed if it
is guaranteed to never become finite.
- Specified by:
hasFixedSize
in interface SizedIterable<Pair<T1,T2>>
- Overrides:
hasFixedSize
in class FilteredRelation<T1,T2>
isStatic
public boolean isStatic()
- Description copied from interface:
SizedIterable
true
if this iterable is unchanging. This implies that hasFixedSize()
is true, and that
iterator()
will always return the same (either ==
or equal()
and immutable) elements
in the same order. ("Immutable" here means that equals()
invocations are consistent over time -- if
two objects are equal, they will never become inequal, and vice versa.)
- Specified by:
isStatic
in interface SizedIterable<Pair<T1,T2>>
- Overrides:
isStatic
in class FilteredRelation<T1,T2>
isEmpty
public boolean isEmpty()
- Description copied from class:
AbstractPredicateSet
- Returns
size(1) == 0
.
- Specified by:
isEmpty
in interface SizedIterable<Pair<T1,T2>>
- Specified by:
isEmpty
in interface Collection<Pair<T1,T2>>
- Specified by:
isEmpty
in interface Set<Pair<T1,T2>>
- Overrides:
isEmpty
in class FilteredRelation<T1,T2>