|
© 1998-2002 McGraw-Hill | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--structure.Entry
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. 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);
...
| Field Summary | |
protected Object |
theKey
|
protected Object |
theValue
The mutable value. |
| Constructor Summary | |
Entry(Object key)
Constructs a pair from a key; value is null. |
|
Entry(Object key,
Object value)
Constructs a pair from a key and value. |
|
| Method Summary | |
boolean |
equals(Object other)
Standard comparison function. |
Object |
getKey()
Fetch key from association. |
Object |
getValue()
Fetch value from association. |
int |
hashCode()
Standard hashcode function. |
Object |
setValue(Object value)
Sets the value of the key-value pair. |
String |
toString()
Standard string representation of an association. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Object theKey
protected Object theValue
| Constructor Detail |
public Entry(Object key,
Object value)
key - A non-null object.value - A (possibly null) object.public Entry(Object key)
key - A non-null key value.| Method Detail |
public boolean equals(Object other)
equals in interface Map.Entryequals in class Objectother - Another association.public int hashCode()
hashCode in interface Map.EntryhashCode in class ObjectHashtablepublic Object getValue()
getValue in interface Map.Entrypublic Object getKey()
getKey in interface Map.Entrypublic Object setValue(Object value)
setValue in interface Map.Entryvalue - The new value.public String toString()
toString in class Object
|
© 1998-2002 McGraw-Hill | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||