|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.util
Class Hashtable.HashEntry

java.lang.Objectjava.util.AbstractMap.BasicMapEntry
java.util.Hashtable.HashEntry
- All Implemented Interfaces:
- Map.Entry
- Enclosing class:
- Hashtable
- private static final class Hashtable.HashEntry
- extends AbstractMap.BasicMapEntry
Class to represent an entry in the hash table. Holds a single key-value pair. A Hashtable Entry is identical to a HashMap Entry, except that `null' is not allowed for keys and values.
| Field Summary | |
(package private) java.lang.Object |
key
The key. |
(package private) Hashtable.HashEntry |
next
The next entry in the linked list. |
(package private) java.lang.Object |
value
The value. |
| Constructor Summary | |
(package private) |
Hashtable.HashEntry(java.lang.Object key,
java.lang.Object value)
Simple constructor. |
| Method Summary | |
boolean |
equals(java.lang.Object o)
Compares the specified object with this entry. |
java.lang.Object |
getKey()
Get the key corresponding to this entry. |
java.lang.Object |
getValue()
Get the value corresponding to this entry. |
int |
hashCode()
Returns the hash code of the entry. |
java.lang.Object |
setValue(java.lang.Object newVal)
Resets the value. |
java.lang.String |
toString()
This provides a string representation of the entry. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
next
Hashtable.HashEntry next
- The next entry in the linked list.
key
java.lang.Object key
- The key. Package visible for direct manipulation.
value
java.lang.Object value
- The value. Package visible for direct manipulation.
| Constructor Detail |
Hashtable.HashEntry
Hashtable.HashEntry(java.lang.Object key, java.lang.Object value)
- Simple constructor.
| Method Detail |
setValue
public java.lang.Object setValue(java.lang.Object newVal)
- Resets the value.
- Specified by:
setValuein interfaceMap.Entry- Overrides:
setValuein classAbstractMap.BasicMapEntry
equals
public final boolean equals(java.lang.Object o)
- Compares the specified object with this entry. Returns true only if
the object is a mapping of identical key and value. In other words,
this must be:
(o instanceof Map.Entry) && (getKey() == null ? ((HashMap) o).getKey() == null : getKey().equals(((HashMap) o).getKey())) && (getValue() == null ? ((HashMap) o).getValue() == null : getValue().equals(((HashMap) o).getValue()))
getKey
public final java.lang.Object getKey()
getValue
public final java.lang.Object getValue()
- Get the value corresponding to this entry. If you already called
Iterator.remove(), the behavior undefined, but in this case it works.
hashCode
public final int hashCode()
- Returns the hash code of the entry. This is defined as the exclusive-or
of the hashcodes of the key and value (using 0 for null). In other
words, this must be:
(getKey() == null ? 0 : getKey().hashCode()) ^ (getValue() == null ? 0 : getValue().hashCode())
toString
public final java.lang.String toString()
- This provides a string representation of the entry. It is of the form
"key=value", where string concatenation is used on key and value.
|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC