topology
public class ComparablePair<K extends java.lang.Comparable<K>,V extends java.lang.Comparable<V>> extends java.lang.Object implements java.lang.Comparable<Pair<K,V>>, Pair<K,V>
Constructor and Description |
---|
ComparablePair()
Initialises a ComparablePair.
|
ComparablePair(K key,
V value)
Creates a ComparablePair with given key and value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Pair<K,V> a)
Compares a ComparablePair with a pair.
|
K |
getKey()
Returns the key (= first element) of a ComparablePair.
|
V |
getValue()
Returns the value (= second element) of a ComparablePair.
|
java.lang.String |
toString()
Returns a string representation of this ComparablePair.
|
public K getKey()
public V getValue()
public int compareTo(Pair<K,V> a)
public java.lang.String toString()
toString
in class java.lang.Object