|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectstructure5.Entry<K,V>
public class Entry<K,V>
An implementation of the the java.util.Map.Entry interface, Entry
is a simple key value pair, from which both the key and the value
can be accessed. structure.Association and related classes
also implement the Map interface and have expanded functionality.
Typical Usage:
...
Entry e = new Entry(aKey, aValue);
Object key = e.getKey();
Object value = e.getValue();
e.setValue(newValue);
...
| Constructor Summary | |
|---|---|
Entry(K key)
Constructs a pair from a key; value is null. |
|
Entry(K key,
V value)
Constructs a pair from a key and value. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object other)
Standard comparison function. |
K |
getKey()
Fetch key from association. |
V |
getValue()
Fetch value from association. |
int |
hashCode()
Standard hashcode function. |
V |
setValue(V value)
Sets the value of the key-value pair. |
String |
toString()
Standard string representation of an association. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Entry(K key,
V value)
key - A non-null object.value - A (possibly null) object.public Entry(K key)
key - A non-null key value.| Method Detail |
|---|
public boolean equals(Object other)
equals in interface Map.Entry<K,V>equals in class Objectother - Another association.
public int hashCode()
hashCode in interface Map.Entry<K,V>hashCode in class ObjectHashtablepublic V getValue()
getValue in interface Map.Entry<K,V>public K getKey()
getKey in interface Map.Entry<K,V>public V setValue(V value)
setValue in interface Map.Entry<K,V>value - The new value.public String toString()
toString in class Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||