|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface OneToOneRelation<T1,T2>
A injective functional relation: each first (of type T1) corresponds to at most one
second (of type T2), and vice versa. The inverse of a one-to-one relation is also a
one-to-one relation.
| Method Summary | |
|---|---|
boolean |
add(Pair<T1,T2> pair)
Add a pair to the set. |
boolean |
add(T1 first,
T2 second)
Add Pair.make(first, second) to the set. |
OneToOneRelation<T2,T1> |
inverse()
Produce the inverse of the relation, derived by swapping the elements of each pair. |
| Methods inherited from interface edu.rice.cs.plt.collect.FunctionalRelation |
|---|
functionMap, matchFirst, value |
| 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 |
| Method Detail |
|---|
boolean add(Pair<T1,T2> pair)
add in interface java.util.Collection<Pair<T1,T2>>add in interface FunctionalRelation<T1,T2>add in interface InjectiveRelation<T1,T2>add in interface Relation<T1,T2>add in interface java.util.Set<Pair<T1,T2>>java.lang.IllegalArgumentException - If containsFirst(pair.first()) or
containsSecond(pair.second()) but not contains(pair).
boolean add(T1 first,
T2 second)
Pair.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 Relation<T1,T2>java.lang.IllegalArgumentException - If containsFirst(first) or containsSecond(second)
but not contains(first, second).OneToOneRelation<T2,T1> inverse()
inverse in interface FunctionalRelation<T1,T2>inverse in interface InjectiveRelation<T1,T2>inverse in interface Relation<T1,T2>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||