Package libai.common
Class Pair<V extends java.lang.Comparable<V>,K>
- java.lang.Object
-
- libai.common.Pair<V,K>
-
- All Implemented Interfaces:
java.lang.Comparable<Pair<V,K>>
public final class Pair<V extends java.lang.Comparable<V>,K> extends java.lang.Object implements java.lang.Comparable<Pair<V,K>>
Pair class allows to keep two elements of possibly different types in the same structure and can be used for keep pairs key-value.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Pair<V,K> o)
Compare two pairs by the first element.boolean
equals(java.lang.Object obj)
int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
compareTo
public int compareTo(Pair<V,K> o)
Compare two pairs by the first element. The first element type must implement the Comparable interface.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-