|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.tum.cs.commons.collections.ImmutablePair<S,T>
public class ImmutablePair<S,T>
Simple readonly pair class.
| Field Summary | |
|---|---|
protected S |
first
The first element. |
protected T |
second
The second element. |
| Constructor Summary | |
|---|---|
ImmutablePair(ImmutablePair<S,T> p)
Copy constructor. |
|
ImmutablePair(S first,
T second)
Constructor. |
|
| Method Summary | |
|---|---|
protected ImmutablePair<S,T> |
clone()
|
int |
compareTo(ImmutablePair<S,T> pair)
Compare based on first element. |
ImmutablePair<S,T> |
deepClone()
Deep clone of this object. |
boolean |
equals(Object obj)
|
S |
getFirst()
Returns the first element of the pair. |
T |
getSecond()
Returns the second element of the pair. |
int |
hashCode()
The hash code is based on the hash code of the first and second members. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected S first
protected T second
| Constructor Detail |
|---|
public ImmutablePair(S first,
T second)
public ImmutablePair(ImmutablePair<S,T> p)
| Method Detail |
|---|
public S getFirst()
public T getSecond()
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
The hash code is based on the hash code of the first and second members.
hashCode in class Objectpublic String toString()
toString in class Objectprotected ImmutablePair<S,T> clone()
clone in class Object
public ImmutablePair<S,T> deepClone()
throws DeepCloneException
deepClone in interface IDeepCloneableDeepCloneException - if problems during cloning occured.public int compareTo(ImmutablePair<S,T> pair)
Compare based on first element. Use second element only if first elements are equal. Null entries are sorted to the top.
compareTo in interface Comparable<ImmutablePair<S,T>>
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||