org.apache.commons.collections.map

Class AbstractHashedMap.HashEntry

Enclosing Class:
AbstractHashedMap
Implemented Interfaces:
Map.Entry, KeyValue
Known Direct Subclasses:
AbstractLinkedMap.LinkEntry, AbstractReferenceMap.ReferenceEntry, IdentityMap.IdentityEntry

protected static class AbstractHashedMap.HashEntry
extends java.lang.Object
implements Map.Entry, KeyValue

HashEntry used to store the data.

If you subclass AbstractHashedMap but not HashEntry then you will not be able to access the protected fields. The entryXxx() methods on AbstractHashedMap exist to provide the necessary access.

Field Summary

protected int
hashCode
The hash code of the key
protected Object
key
The key
protected AbstractHashedMap.HashEntry
next
The next entry in the hash chain
protected Object
value
The value

Constructor Summary

HashEntry(AbstractHashedMap.HashEntry next, int hashCode, Object key, Object value)

Method Summary

boolean
equals(Object obj)
Object
getKey()
Gets the key from the pair.
Object
getValue()
Gets the value from the pair.
int
hashCode()
Object
setValue(Object value)
String
toString()

Field Details

hashCode

protected int hashCode
The hash code of the key

key

protected Object key
The key

AbstractHashedMap.HashEntry next
The next entry in the hash chain

value

protected Object value
The value

Constructor Details

HashEntry

protected HashEntry(AbstractHashedMap.HashEntry next,
                    int hashCode,
                    Object key,
                    Object value)

Method Details

equals

public boolean equals(Object obj)

getKey

public Object getKey()
Gets the key from the pair.
Specified by:
getKey in interface KeyValue
Returns:
the key

getValue

public Object getValue()
Gets the value from the pair.
Specified by:
getValue in interface KeyValue
Returns:
the value

hashCode

public int hashCode()

setValue

public Object setValue(Object value)

toString

public String toString()

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.