csli.util
Class Pair<A1,B2>
java.lang.Object
csli.util.Pair<A1,B2>
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ComparablePair
public class Pair<A1,B2>
- extends Object
- implements Serializable
Pair of objects (when you need to return two, or put them on a list)
- Author:
- Danilo Mirkovic
- See Also:
- Serialized Form
a
public A1 a
b
public B2 b
onlyFirstToString
public boolean onlyFirstToString
Pair
public Pair(A1 a,
B2 b)
Pair
public Pair(Pair<A1,B2> p)
Pair
public Pair(A1 a,
B2 b,
boolean onlyFirstToString)
first
public A1 first()
second
public B2 second()
getBool
public boolean getBool()
getInt
public int getInt()
getDouble
public double getDouble()
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object obj)
- Tests for equality against another object.
Two pairs are equal if and only if:
- their first elements are equal, and:
- their second elements are equal
- Overrides:
equals in class Object
- Parameters:
obj - The object to test against.
- Returns:
- True if the two objects are equal.