|
||||||||||
| 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>
public abstract class AbstractFunctionalRelation<T1,T2>
An abstract parent class for implementations of FunctionalRelation. Subclasses must provide
isStatic(), functionMap(), secondSet(), and matchSecond(T2).
To support mutation, they must also override AbstractRelation.add(Object, Object)
and AbstractRelation.remove(Object, Object). For best performance, they may also override
AbstractCollection.clear().
| Nested Class Summary | |
|---|---|
protected class |
AbstractFunctionalRelation.InverseFunctionalRelation
An inverse of the enclosing relation. |
| Nested classes/interfaces inherited from class edu.rice.cs.plt.collect.AbstractRelation |
|---|
AbstractRelation.InverseRelation |
| Constructor Summary | |
|---|---|
AbstractFunctionalRelation()
|
|
| Method Summary | |
|---|---|
boolean |
contains(Object obj)
Checks for the given entry in functionMap(). |
boolean |
contains(T1 first,
T2 second)
Checks for the given entry in functionMap(). |
boolean |
containsFirst(T1 first)
Returns functionMap().containsKey(first). |
PredicateSet<T1> |
firstSet()
Returns functionMap().keySet(). |
abstract LambdaMap<T1,T2> |
functionMap()
A map view of the relation, mapping firsts to seconds. |
boolean |
hasFixedSize()
Returns functionMap().keySet().hasFixedSize(). |
Relation<T2,T1> |
inverse()
Returns an AbstractFunctionalRelation.InverseFunctionalRelation. |
boolean |
isEmpty()
Returns functionMap().isEmpty(). |
boolean |
isInfinite()
Returns functionMap().keySet().isInfinite(). |
abstract boolean |
isStatic()
true if this iterable is unchanging. |
Iterator<Pair<T1,T2>> |
iterator()
Produces an iterator based on functionMap().entrySet(). |
PredicateSet<T2> |
matchFirst(T1 first)
Returns a set that queries and manipulates the mapping from first in functionMap(). |
abstract PredicateSet<T1> |
matchSecond(T2 second)
The set of firsts corresponding to a specific second. |
abstract PredicateSet<T2> |
secondSet()
The set of seconds. |
int |
size()
Returns functionMap().size(). |
int |
size(int bound)
Returns functionMap().keySet().size(bound). |
T2 |
value(T1 first)
Returns functionMap().get(first). |
| Methods inherited from class edu.rice.cs.plt.collect.AbstractRelation |
|---|
add, add, containsSecond, 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.FunctionalRelation |
|---|
add, add |
| Methods inherited from interface edu.rice.cs.plt.collect.Relation |
|---|
containsSecond, excludeFirsts, excludeSeconds, remove, remove |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public AbstractFunctionalRelation()
| Method Detail |
|---|
public abstract 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 AbstractRelation<T1,T2>public abstract LambdaMap<T1,T2> functionMap()
FunctionalRelation
functionMap in interface FunctionalRelation<T1,T2>public abstract PredicateSet<T2> secondSet()
Relation
secondSet in interface Relation<T1,T2>secondSet in class AbstractRelation<T1,T2>public abstract PredicateSet<T1> matchSecond(T2 second)
Relation
matchSecond in interface Relation<T1,T2>matchSecond in class AbstractRelation<T1,T2>public boolean isEmpty()
functionMap().isEmpty().
isEmpty in interface SizedIterable<Pair<T1,T2>>isEmpty in interface Collection<Pair<T1,T2>>isEmpty in interface Set<Pair<T1,T2>>isEmpty in class AbstractPredicateSet<Pair<T1,T2>>public int size()
functionMap().size().
size in interface SizedIterable<Pair<T1,T2>>size in interface Collection<Pair<T1,T2>>size in interface Set<Pair<T1,T2>>size in class AbstractPredicateSet<Pair<T1,T2>>public int size(int bound)
functionMap().keySet().size(bound).
size in interface SizedIterable<Pair<T1,T2>>size in class AbstractPredicateSet<Pair<T1,T2>>bound - Maximum result. Assumed to be nonnegative.public boolean isInfinite()
functionMap().keySet().isInfinite().
isInfinite in interface SizedIterable<Pair<T1,T2>>isInfinite in class AbstractRelation<T1,T2>public boolean hasFixedSize()
functionMap().keySet().hasFixedSize().
hasFixedSize in interface SizedIterable<Pair<T1,T2>>hasFixedSize in class AbstractRelation<T1,T2>
public boolean contains(T1 first,
T2 second)
functionMap().
contains in interface Relation<T1,T2>contains in interface Predicate2<T1,T2>contains in class AbstractRelation<T1,T2>public boolean contains(Object obj)
functionMap().
contains in interface Relation<T1,T2>contains in interface Predicate<Object>contains in interface Collection<Pair<T1,T2>>contains in interface Set<Pair<T1,T2>>contains in class AbstractRelation<T1,T2>public Iterator<Pair<T1,T2>> iterator()
functionMap().entrySet().
iterator in interface Iterable<Pair<T1,T2>>iterator in interface Collection<Pair<T1,T2>>iterator in interface Set<Pair<T1,T2>>iterator in class AbstractRelation<T1,T2>public PredicateSet<T1> firstSet()
functionMap().keySet().
firstSet in interface Relation<T1,T2>firstSet in class AbstractRelation<T1,T2>public boolean containsFirst(T1 first)
functionMap().containsKey(first).
containsFirst in interface Relation<T1,T2>containsFirst in class AbstractRelation<T1,T2>public PredicateSet<T2> matchFirst(T1 first)
first in functionMap().
matchFirst in interface FunctionalRelation<T1,T2>matchFirst in interface Relation<T1,T2>matchFirst in class AbstractRelation<T1,T2>public T2 value(T1 first)
functionMap().get(first).
value in interface FunctionalRelation<T1,T2>value in interface Lambda<T1,T2>public Relation<T2,T1> inverse()
AbstractFunctionalRelation.InverseFunctionalRelation.
inverse in interface FunctionalRelation<T1,T2>inverse in interface Relation<T1,T2>inverse in class AbstractRelation<T1,T2>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||