T1
- Type for the first element of the tuple.T2
- Type for the second element of the tuple.public class Pair<T1,T2> extends UnaryTuple<T1>
Modifier | Constructor and Description |
---|---|
protected |
Pair(T1 first,
T2 second)
Constructs a 2-tuple.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
T2 |
getSecond()
Gets the second element of the tuple.
|
int |
hashCode() |
void |
setSecond(T2 second)
Sets the second element of the tuple.
|
String |
toString() |
static <TT1,TT2> Pair<TT1,TT2> |
valueOf(TT1 first,
TT2 second)
Creates a new 2-tuple using the given values.
|
getFirst, setFirst, valueOf
public static <TT1,TT2> Pair<TT1,TT2> valueOf(TT1 first, TT2 second)
TT1
- the type for the first element of the tuple.TT2
- the type for the second element of the tuple.first
- First element in the tuple.second
- Second element in the tuple.public T2 getSecond()
public void setSecond(T2 second)
second
- The Second element.public int hashCode()
hashCode
in class UnaryTuple<T1>
public boolean equals(Object obj)
equals
in class UnaryTuple<T1>
public String toString()
toString
in class UnaryTuple<T1>
Copyright © 2015. All Rights Reserved.