Package org.planit.utils.misc
Class Pair<A,B>
- java.lang.Object
-
- org.planit.utils.misc.Pair<A,B>
-
- Type Parameters:
A
- first object in pairB
- second object in pair
public class Pair<A,B> extends Object
Custom pair class similar to C++. By default we compare based on the first value- Author:
- markr
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object other)
Compare to another pair- Overrides:
equals
in classObject
- Parameters:
other
- pair being compared to- See Also:
Object.equals(java.lang.Object)
-
toString
public String toString()
Convert to string- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
getFirst
public A getFirst()
Get first object in pair- Returns:
- first object in pair
-
getSecond
public B getSecond()
Get second object in pair- Returns:
- second object in pair
-
-