|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.container.Pair<K,V>
K
- The key value.V
- The Object to associate to the key.public class Pair<K extends Comparable<? super K>,V>
Simple structure to associate a key to a value.
Constructor Summary | |
---|---|
Pair()
Default constructor. |
|
Pair(K key,
V value)
Construct a Pair with the given key and value. |
|
Pair(Pair<K,V> copy)
Copy constructor. |
Method Summary | |
---|---|
int |
compareTo(Pair<K,V> o)
|
boolean |
equals(Object obj)
|
Pair<K,V> |
getClone()
Create a cloned copy of the current object and return it. |
K |
getKey()
|
V |
getValue()
|
int |
hashCode()
|
void |
setKey(K key)
|
void |
setValue(V value)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pair()
null
.
public Pair(K key, V value)
key
- The key value to set.value
- The object to associate with this key.public Pair(Pair<K,V> copy)
copy
- The object to copy.Method Detail |
---|
public Pair<K,V> getClone()
getClone
in interface Cloneable
Object.clone()
public K getKey()
public void setKey(K key)
key
- The key to set.public V getValue()
public void setValue(V value)
value
- The value to set.public int compareTo(Pair<K,V> o)
compareTo
in interface Comparable<Pair<K extends Comparable<? super K>,V>>
o
- The Pair to perform the comparison with.
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |