edu.rice.cs.plt.collect
Class AbstractOneToOneRelation.InverseOneToOneRelation

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<T>
          extended by edu.rice.cs.plt.collect.AbstractPredicateSet<Pair<T2,T1>>
              extended by edu.rice.cs.plt.collect.AbstractRelation.InverseRelation
                  extended by edu.rice.cs.plt.collect.AbstractFunctionalRelation.InverseFunctionalRelation
                      extended by edu.rice.cs.plt.collect.AbstractOneToOneRelation.InverseOneToOneRelation
All Implemented Interfaces:
FunctionalRelation<T2,T1>, InjectiveRelation<T2,T1>, OneToOneRelation<T2,T1>, PredicateSet<Pair<T2,T1>>, Relation<T2,T1>, SizedIterable<Pair<T2,T1>>, Lambda<T2,T1>, Predicate<java.lang.Object>, Predicate2<T2,T1>, java.io.Serializable, java.lang.Iterable<Pair<T2,T1>>, java.util.Collection<Pair<T2,T1>>, java.util.Set<Pair<T2,T1>>
Enclosing class:
AbstractOneToOneRelation<T1,T2>

protected class AbstractOneToOneRelation.InverseOneToOneRelation
extends AbstractFunctionalRelation.InverseFunctionalRelation
implements OneToOneRelation<T2,T1>

An inverse of the enclosing relation. Extends AbstractFunctionalRelation.InverseFunctionalRelation with the methods necessary to implement OneToOneRelation.

See Also:
Serialized Form

Constructor Summary
protected AbstractOneToOneRelation.InverseOneToOneRelation()
           
 
Method Summary
 LambdaMap<T2,T1> functionMap()
          A map view of the relation, mapping firsts to seconds.
 OneToOneRelation<T1,T2> inverse()
          Produce the inverse of the relation, derived by swapping the elements of each pair.
 T1 value(T2 first)
          Produce the second corresponding to first, or null if there is none.
 
Methods inherited from class edu.rice.cs.plt.collect.AbstractFunctionalRelation.InverseFunctionalRelation
antecedent, injectionMap
 
Methods inherited from class edu.rice.cs.plt.collect.AbstractRelation.InverseRelation
add, add, clear, contains, contains, containsFirst, containsSecond, excludeFirsts, excludeSeconds, firstSet, hasFixedSize, isEmpty, isInfinite, isStatic, iterator, matchFirst, matchSecond, remove, remove, secondSet, size, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, 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
matchFirst
 
Methods inherited from interface edu.rice.cs.plt.collect.InjectiveRelation
antecedent, injectionMap, matchSecond
 
Methods inherited from interface edu.rice.cs.plt.collect.Relation
contains, contains, containsFirst, containsSecond, excludeFirsts, excludeSeconds, firstSet, remove, remove, secondSet
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface edu.rice.cs.plt.iter.SizedIterable
hasFixedSize, isEmpty, isInfinite, isStatic, size, size
 

Constructor Detail

AbstractOneToOneRelation.InverseOneToOneRelation

protected AbstractOneToOneRelation.InverseOneToOneRelation()
Method Detail

value

public T1 value(T2 first)
Description copied from interface: FunctionalRelation
Produce the second corresponding to first, or null if there is none.

Specified by:
value in interface FunctionalRelation<T2,T1>
Specified by:
value in interface Lambda<T2,T1>

functionMap

public LambdaMap<T2,T1> functionMap()
Description copied from interface: FunctionalRelation
A map view of the relation, mapping firsts to seconds. Need not allow mutation, but must reflect subsequent changes.

Specified by:
functionMap in interface FunctionalRelation<T2,T1>

inverse

public OneToOneRelation<T1,T2> inverse()
Description copied from interface: Relation
Produce the inverse of the relation, derived by swapping the elements of each pair. Need not allow mutation, but must reflect subsequent changes.

Specified by:
inverse in interface FunctionalRelation<T2,T1>
Specified by:
inverse in interface InjectiveRelation<T2,T1>
Specified by:
inverse in interface OneToOneRelation<T2,T1>
Specified by:
inverse in interface Relation<T2,T1>
Overrides:
inverse in class AbstractFunctionalRelation.InverseFunctionalRelation