|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectUPair
public final class UPair
A sorted pair of ints.
This class conforms to the immutable design pattern.
Field Summary | |
---|---|
int |
s1
The smaller int. |
int |
s2
The larger int. |
Constructor Summary | |
---|---|
UPair(Integer i1,
Integer i2)
Initializes the upair; sorts the ints before storing them. |
|
UPair(int i1,
int i2)
Initializes the upair; sorts the ints before storing them. |
|
UPair(Pair p)
Initializes the upair from another upair. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Fulfills java.lang.Object. |
int |
hashCode()
Fulfills java.lang.Object. |
Methods inherited from class Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int s1
public final int s2
Constructor Detail |
---|
public UPair(Pair p)
p
- the other upair.public UPair(Integer i1, Integer i2)
i1
- one of the ints.i2
- the other int.public UPair(int i1, int i2)
i1
- one of the ints.i2
- the other int.Method Detail |
---|
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |