|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.plt.collect.EmptyCollection<Pair<T1,T2>>
edu.rice.cs.plt.collect.EmptyRelation<T1,T2>
public final class EmptyRelation<T1,T2>
An immutable, empty, one-to-one relation.
| Field Summary | |
|---|---|
static EmptyRelation<java.lang.Object,java.lang.Object> |
INSTANCE
|
| Method Summary | ||
|---|---|---|
boolean |
add(T1 first,
T2 second)
Add Pair.make(first, second) to the set. |
|
T1 |
antecedent(T2 second)
Produce the first corresponding to second, or null if there is none. |
|
boolean |
contains(T1 first,
T2 second)
Whether Pair.make(first, second) appears in the set. |
|
boolean |
containsFirst(T1 first)
Whether a pair with the given first value appears in the set. |
|
boolean |
containsSecond(T2 second)
Whether a pair with the given second value appears in the set. |
|
boolean |
equals(java.lang.Object o)
|
|
PredicateSet<T2> |
excludeFirsts()
The set of seconds for which there exists a (first, second) pair in the relation. |
|
PredicateSet<T1> |
excludeSeconds()
The set of firsts for which there exists a (first, second) pair in the relation. |
|
PredicateSet<T1> |
firstSet()
The set of firsts. |
|
LambdaMap<T1,T2> |
functionMap()
A map view of the relation, mapping firsts to seconds. |
|
int |
hashCode()
|
|
LambdaMap<T2,T1> |
injectionMap()
A map view of the relation, mapping seconds to firsts. |
|
OneToOneRelation<T2,T1> |
inverse()
Produce the inverse of the relation, derived by swapping the elements of each pair. |
|
static
|
make()
Return a singleton, cast to the appropriate type. |
|
PredicateSet<T2> |
matchFirst(T1 first)
The set of seconds corresponding to a specific first. |
|
PredicateSet<T1> |
matchSecond(T2 second)
The set of firsts corresponding to a specific second. |
|
boolean |
remove(T1 first,
T2 second)
Remove Pair.make(first, second) from the set. |
|
PredicateSet<T2> |
secondSet()
The set of seconds. |
|
T2 |
value(T1 first)
Produce the second corresponding to first, or null if there is none. |
|
| Methods inherited from class edu.rice.cs.plt.collect.EmptyCollection |
|---|
add, addAll, clear, contains, containsAll, hasFixedSize, isEmpty, isInfinite, isStatic, iterator, remove, removeAll, retainAll, size, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.rice.cs.plt.collect.OneToOneRelation |
|---|
add |
| Methods inherited from interface edu.rice.cs.plt.collect.Relation |
|---|
contains, remove |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, containsAll, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface edu.rice.cs.plt.iter.SizedIterable |
|---|
hasFixedSize, isEmpty, isInfinite, isStatic, size, size |
| Field Detail |
|---|
public static final EmptyRelation<java.lang.Object,java.lang.Object> INSTANCE
| Method Detail |
|---|
public boolean contains(T1 first,
T2 second)
RelationPair.make(first, second) appears in the set.
contains in interface Relation<T1,T2>contains in interface Predicate2<T1,T2>
public boolean add(T1 first,
T2 second)
OneToOneRelationPair.make(first, second) to the set. If the pair violates the cardinality constraint,
throw an exception.
add in interface FunctionalRelation<T1,T2>add in interface InjectiveRelation<T1,T2>add in interface OneToOneRelation<T1,T2>add in interface Relation<T1,T2>
public boolean remove(T1 first,
T2 second)
RelationPair.make(first, second) from the set.
remove in interface Relation<T1,T2>public OneToOneRelation<T2,T1> inverse()
OneToOneRelation
inverse in interface FunctionalRelation<T1,T2>inverse in interface InjectiveRelation<T1,T2>inverse in interface OneToOneRelation<T1,T2>inverse in interface Relation<T1,T2>public PredicateSet<T1> firstSet()
Relation
firstSet in interface Relation<T1,T2>public boolean containsFirst(T1 first)
Relation
containsFirst in interface Relation<T1,T2>public PredicateSet<T2> matchFirst(T1 first)
FunctionalRelation
matchFirst in interface FunctionalRelation<T1,T2>matchFirst in interface Relation<T1,T2>public PredicateSet<T2> excludeFirsts()
RelationRelation.secondSet(), but defined redundantly for consistency
with higher-arity relations. Need not allow mutation, but must reflect subsequent changes.
excludeFirsts in interface Relation<T1,T2>public PredicateSet<T2> secondSet()
Relation
secondSet in interface Relation<T1,T2>public boolean containsSecond(T2 second)
Relation
containsSecond in interface Relation<T1,T2>public PredicateSet<T1> matchSecond(T2 second)
Relation
matchSecond in interface InjectiveRelation<T1,T2>matchSecond in interface Relation<T1,T2>public PredicateSet<T1> excludeSeconds()
RelationRelation.firstSet(), but defined redundantly for consistency
with higher-arity relations. Need not allow mutation, but must reflect subsequent changes.
excludeSeconds in interface Relation<T1,T2>public T2 value(T1 first)
FunctionalRelationfirst, or null if there is none.
value in interface FunctionalRelation<T1,T2>value in interface Lambda<T1,T2>public T1 antecedent(T2 second)
InjectiveRelationsecond, or null if there is none.
antecedent in interface InjectiveRelation<T1,T2>public LambdaMap<T1,T2> functionMap()
FunctionalRelation
functionMap in interface FunctionalRelation<T1,T2>public LambdaMap<T2,T1> injectionMap()
InjectiveRelation
injectionMap in interface InjectiveRelation<T1,T2>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<Pair<T1,T2>>equals in interface java.util.Set<Pair<T1,T2>>equals in class EmptyCollection<Pair<T1,T2>>public int hashCode()
hashCode in interface java.util.Collection<Pair<T1,T2>>hashCode in interface java.util.Set<Pair<T1,T2>>hashCode in class EmptyCollection<Pair<T1,T2>>public static <T1,T2> EmptyRelation<T1,T2> make()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||