Package org.roaringbitmap.bsi
Class Pair<T1,T2>
- java.lang.Object
-
- org.roaringbitmap.bsi.Pair<T1,T2>
-
- Type Parameters:
T1-T2-
- All Implemented Interfaces:
java.io.Serializable
public class Pair<T1,T2> extends java.lang.Object implements java.io.SerializableA generic class for pairs. Copied from org.apache.hadoop.hbase.util.Pair- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)T1getKey()T1getLeft()Return the left element stored in the pair.T2getRight()Return the right element stored in the pair.T2getValue()inthashCode()static <T1,T2>
Pair<T1,T2>newPair(T1 a, T2 b)Constructs a new pair, inferring the type via the passed argumentsvoidsetFirst(T1 a)Replace the left element of the pair.voidsetSecond(T2 b)Replace the right element of the pair.java.lang.StringtoString()
-
-
-
Method Detail
-
newPair
public static <T1,T2> Pair<T1,T2> newPair(T1 a, T2 b)
Constructs a new pair, inferring the type via the passed arguments- Type Parameters:
T1- type for leftT2- type for right- Parameters:
a- left elementb- right element- Returns:
- a new pair containing the passed arguments
-
getLeft
public T1 getLeft()
Return the left element stored in the pair.- Returns:
- T1
-
getKey
public T1 getKey()
-
setFirst
public void setFirst(T1 a)
Replace the left element of the pair.- Parameters:
a- operand
-
getRight
public T2 getRight()
Return the right element stored in the pair.- Returns:
- T2
-
getValue
public T2 getValue()
-
setSecond
public void setSecond(T2 b)
Replace the right element of the pair.- Parameters:
b- operand
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-