|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.csail.sdg.alloy4.Pair<A,B>
public final class Pair<A,B>
Immutable; stores a pair of object references; Pair.equals() compares by calling equals() on both components.
Thread Safety: Safe (since objects of this class are immutable).
| Field Summary | |
|---|---|
A |
a
The first half of the pair. |
B |
b
The second half of the pair. |
| Constructor Summary | |
|---|---|
Pair(A a,
B b)
Constructs a new Pair object (a,b). |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object that)
Pairs (a1, b1) and (a2, b2) are equal iff (a1==null ? a2==null : a1.equals(a2)) and (b1==null ? b2==null : b1.equals(b2)) |
int |
hashCode()
Returns a hashcode based on (a==null?0:a.hashCode()) and (b==null?0:b.hashCode()). |
java.lang.String |
toString()
If "a" and "b" are both String, concatename them with a space; if only one is, return it; else call toString() on them. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final A a
public final B b
| Constructor Detail |
|---|
public Pair(A a,
B b)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object that)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||