Package com.groiss.ds
Class Pair<F,S>
java.lang.Object
com.groiss.ds.Pair<F,S>
- All Implemented Interfaces:
KeyValuePair<F,
,S> Serializable
- Direct Known Subclasses:
ComparablePair
,Parameter
A Pair is an object that contains two other objects.
It is most commonly used for conveniently storing and passing pairs of objects.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
first
The first object. -
second
The second object.
-
-
Constructor Details
-
Pair
public Pair() -
Pair
Constructor for holding a pair of objects.
-
-
Method Details
-
getKey
Return the first object- Specified by:
getKey
in interfaceKeyValuePair<F,
S>
-
getValue
Return the second object- Specified by:
getValue
in interfaceKeyValuePair<F,
S>
-
toString
-
equals
Returnstrue
ifobj
is also a Pair and contains two objects equal to the two objects of this Pair.null
references are considered as equal, too. -
hashCode
public int hashCode()Builds a new hash code out of the two objects' hash codes.
-