|
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(java.lang.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. |
java.lang.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(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
The hash code is based on the hash code of the first and second members.
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected ImmutablePair<S,T> clone()
clone
in class java.lang.Object
public ImmutablePair<S,T> deepClone() throws DeepCloneException
deepClone
in interface IDeepCloneable
DeepCloneException
- 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 java.lang.Comparable<ImmutablePair<S,T>>
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |