Package com.amalgamasimulation.utils
Class Pair<T1,T2>
java.lang.Object
com.amalgamasimulation.utils.Pair<T1,T2>
- Type Parameters:
T1- type of the first elementT2- type of the second element
Class representing a pair of elements of the specified types.
first
and second are public fields of this class allowing the direct
access to the contents of the pair.- Author:
- Andrey Malykhanov
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
first
First element of this pair -
second
Second element of this pair
-
-
Constructor Details
-
Pair
Creates a new pair consisting of the specified elements- Parameters:
first- first element of this pairsecond- second element of this pair
-
-
Method Details
-
of
Creates and returns a new pair consisting of the specified elements- Parameters:
first- first element of this pairsecond- second element of this pair
-
first
Returns the first element of this pair- Returns:
- first element of this pair
-
second
Returns the second element of this pair- Returns:
- second element of this pair
-
toString
-
hashCode
public int hashCode() -
equals
-