|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.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.AbstractFunctionalRelation<T1,T2>
edu.rice.cs.plt.collect.AbstractOneToOneRelation<T1,T2>
edu.rice.cs.plt.collect.SingletonRelation<T1,T2>
public class SingletonRelation<T1,T2>
An immutable Relation containing a single pair.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class edu.rice.cs.plt.collect.AbstractOneToOneRelation |
|---|
AbstractOneToOneRelation.InverseOneToOneRelation |
| Nested classes/interfaces inherited from class edu.rice.cs.plt.collect.AbstractFunctionalRelation |
|---|
AbstractFunctionalRelation.InverseFunctionalRelation |
| Nested classes/interfaces inherited from class edu.rice.cs.plt.collect.AbstractRelation |
|---|
AbstractRelation.InverseRelation |
| Constructor Summary | |
|---|---|
SingletonRelation(Pair<? extends T1,? extends T2> pair)
|
|
SingletonRelation(T1 first,
T2 second)
|
|
| Method Summary | ||
|---|---|---|
boolean |
contains(java.lang.Object obj)
Checks for the given entry in functionMap(). |
|
boolean |
contains(T1 candidate1,
T2 candidate2)
Checks for the given entry in functionMap(). |
|
PredicateSet<T1> |
firstSet()
Returns functionMap().keySet(). |
|
LambdaMap<T1,T2> |
functionMap()
A map view of the relation, mapping firsts to seconds. |
|
boolean |
hasFixedSize()
Returns functionMap().keySet().hasFixedSize(). |
|
LambdaMap<T2,T1> |
injectionMap()
A map view of the relation, mapping seconds to firsts. |
|
OneToOneRelation<T2,T1> |
inverse()
Returns an AbstractOneToOneRelation.InverseOneToOneRelation. |
|
boolean |
isEmpty()
Returns functionMap().isEmpty(). |
|
boolean |
isInfinite()
Returns functionMap().keySet().isInfinite(). |
|
boolean |
isStatic()
true if this iterable is unchanging. |
|
java.util.Iterator<Pair<T1,T2>> |
iterator()
Produces an iterator based on functionMap().entrySet(). |
|
static
|
make(Pair<? extends T1,? extends T2> pair)
Call the constructor (allows type arguments to be inferred) |
|
static
|
make(T1 first,
T2 second)
Call the constructor (allows type arguments to be inferred) |
|
PredicateSet<T2> |
matchFirst(T1 match)
Returns a set that queries and manipulates the mapping from first in functionMap(). |
|
PredicateSet<T1> |
matchSecond(T2 match)
Returns a set that queries and manipulates the mapping from second in injectionMap(). |
|
PredicateSet<T2> |
secondSet()
Returns injectionMap().keySet(). |
|
int |
size()
Returns functionMap().size(). |
|
int |
size(int bound)
Returns functionMap().keySet().size(bound). |
|
| Methods inherited from class edu.rice.cs.plt.collect.AbstractOneToOneRelation |
|---|
antecedent, containsSecond |
| Methods inherited from class edu.rice.cs.plt.collect.AbstractFunctionalRelation |
|---|
containsFirst, value |
| Methods inherited from class edu.rice.cs.plt.collect.AbstractRelation |
|---|
add, add, excludeFirsts, excludeSeconds, remove, remove |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, clear, containsAll, retainAll, 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, add |
| Methods inherited from interface edu.rice.cs.plt.collect.FunctionalRelation |
|---|
value |
| Methods inherited from interface edu.rice.cs.plt.collect.Relation |
|---|
containsFirst, excludeFirsts, excludeSeconds, remove, remove |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public SingletonRelation(T1 first,
T2 second)
public SingletonRelation(Pair<? extends T1,? extends T2> pair)
| Method Detail |
|---|
public boolean isEmpty()
AbstractFunctionalRelationfunctionMap().isEmpty().
isEmpty in interface SizedIterable<Pair<T1,T2>>isEmpty in interface java.util.Collection<Pair<T1,T2>>isEmpty in interface java.util.Set<Pair<T1,T2>>isEmpty in class AbstractFunctionalRelation<T1,T2>public int size()
AbstractFunctionalRelationfunctionMap().size().
size in interface SizedIterable<Pair<T1,T2>>size in interface java.util.Collection<Pair<T1,T2>>size in interface java.util.Set<Pair<T1,T2>>size in class AbstractFunctionalRelation<T1,T2>public int size(int bound)
AbstractFunctionalRelationfunctionMap().keySet().size(bound).
size in interface SizedIterable<Pair<T1,T2>>size in class AbstractFunctionalRelation<T1,T2>bound - Maximum result. Assumed to be nonnegative.public boolean isInfinite()
AbstractFunctionalRelationfunctionMap().keySet().isInfinite().
isInfinite in interface SizedIterable<Pair<T1,T2>>isInfinite in class AbstractFunctionalRelation<T1,T2>public boolean hasFixedSize()
AbstractFunctionalRelationfunctionMap().keySet().hasFixedSize().
hasFixedSize in interface SizedIterable<Pair<T1,T2>>hasFixedSize in class AbstractFunctionalRelation<T1,T2>public boolean isStatic()
SizedIterabletrue 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.)
isStatic in interface SizedIterable<Pair<T1,T2>>isStatic in class AbstractOneToOneRelation<T1,T2>
public boolean contains(T1 candidate1,
T2 candidate2)
AbstractFunctionalRelationfunctionMap().
contains in interface Relation<T1,T2>contains in interface Predicate2<T1,T2>contains in class AbstractFunctionalRelation<T1,T2>public boolean contains(java.lang.Object obj)
AbstractFunctionalRelationfunctionMap().
contains in interface Relation<T1,T2>contains in interface Predicate<java.lang.Object>contains in interface java.util.Collection<Pair<T1,T2>>contains in interface java.util.Set<Pair<T1,T2>>contains in class AbstractFunctionalRelation<T1,T2>public java.util.Iterator<Pair<T1,T2>> iterator()
AbstractFunctionalRelationfunctionMap().entrySet().
iterator in interface java.lang.Iterable<Pair<T1,T2>>iterator in interface java.util.Collection<Pair<T1,T2>>iterator in interface java.util.Set<Pair<T1,T2>>iterator in class AbstractFunctionalRelation<T1,T2>public LambdaMap<T1,T2> functionMap()
FunctionalRelation
functionMap in interface FunctionalRelation<T1,T2>functionMap in class AbstractOneToOneRelation<T1,T2>public LambdaMap<T2,T1> injectionMap()
InjectiveRelation
injectionMap in interface InjectiveRelation<T1,T2>injectionMap in class AbstractOneToOneRelation<T1,T2>public PredicateSet<T1> firstSet()
AbstractFunctionalRelationfunctionMap().keySet().
firstSet in interface Relation<T1,T2>firstSet in class AbstractFunctionalRelation<T1,T2>public PredicateSet<T2> matchFirst(T1 match)
AbstractFunctionalRelationfirst in functionMap().
matchFirst in interface FunctionalRelation<T1,T2>matchFirst in interface Relation<T1,T2>matchFirst in class AbstractFunctionalRelation<T1,T2>public PredicateSet<T2> secondSet()
AbstractOneToOneRelationinjectionMap().keySet().
secondSet in interface Relation<T1,T2>secondSet in class AbstractOneToOneRelation<T1,T2>public PredicateSet<T1> matchSecond(T2 match)
AbstractOneToOneRelationsecond in injectionMap().
matchSecond in interface InjectiveRelation<T1,T2>matchSecond in interface Relation<T1,T2>matchSecond in class AbstractOneToOneRelation<T1,T2>public OneToOneRelation<T2,T1> inverse()
AbstractOneToOneRelationAbstractOneToOneRelation.InverseOneToOneRelation.
inverse in interface FunctionalRelation<T1,T2>inverse in interface InjectiveRelation<T1,T2>inverse in interface OneToOneRelation<T1,T2>inverse in interface Relation<T1,T2>inverse in class AbstractOneToOneRelation<T1,T2>
public static <T1,T2> SingletonRelation<T1,T2> make(T1 first,
T2 second)
public static <T1,T2> SingletonRelation<T1,T2> make(Pair<? extends T1,? extends T2> pair)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||