|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.myjavatools.lib.foundation.Pair<Left,Right>
public class Pair<Left,Right>
Pair<Left, Right> is a class that represents pairs of objects. It is similar to Map.Entry. Pair is immutable.
Map#Entry
Constructor Summary | |
---|---|
Pair(Left left,
Right right)
Constructor, creates a new pair from two objects. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object x)
equals method |
Left |
getKey()
key getter (to implement Map.Entry) |
Right |
getValue()
value getter (to implement Map.Entry) |
int |
hashCode()
some hashcode for Pair made from left and right hash codes |
Left |
left()
left getter |
Right |
right()
right getter |
Right |
setValue(Right value)
value setter - unsupported (immutable class) |
Pair<Right,Left> |
swap()
swaps left and right |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Pair(Left left, Right right)
left
- Leftright
- RightMethod Detail |
---|
public Right setValue(Right value)
setValue
in interface java.util.Map.Entry<Left,Right>
value
- Right ignored
java.lang.UnsupportedOperationException
- - alwayspublic Right getValue()
getValue
in interface java.util.Map.Entry<Left,Right>
public Left getKey()
getKey
in interface java.util.Map.Entry<Left,Right>
public boolean equals(java.lang.Object x)
equals
in interface java.util.Map.Entry<Left,Right>
equals
in class java.lang.Object
x
- Object to compare to
public int hashCode()
hashCode
in interface java.util.Map.Entry<Left,Right>
hashCode
in class java.lang.Object
public final Left left()
public final Right right()
public final Pair<Right,Left> swap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |