Class AbstractHashedMap.HashEntry
- java.lang.Object
-
- org.apache.commons.collections.map.AbstractHashedMap.HashEntry
-
- All Implemented Interfaces:
java.util.Map.Entry,KeyValue
- Direct Known Subclasses:
AbstractLinkedMap.LinkEntry,AbstractReferenceMap.ReferenceEntry,IdentityMap.IdentityEntry
- Enclosing class:
- AbstractHashedMap
protected static class AbstractHashedMap.HashEntry extends java.lang.Object implements java.util.Map.Entry, KeyValue
HashEntry used to store the data.If you subclass
AbstractHashedMapbut notHashEntrythen you will not be able to access the protected fields. TheentryXxx()methods onAbstractHashedMapexist to provide the necessary access.
-
-
Field Summary
Fields Modifier and Type Field Description protected inthashCodeThe hash code of the keyprotected java.lang.ObjectkeyThe keyprotected AbstractHashedMap.HashEntrynextThe next entry in the hash chainprotected java.lang.ObjectvalueThe value
-
Constructor Summary
Constructors Modifier Constructor Description protectedHashEntry(AbstractHashedMap.HashEntry next, int hashCode, java.lang.Object key, java.lang.Object value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.ObjectgetKey()Gets the key from the pair.java.lang.ObjectgetValue()Gets the value from the pair.inthashCode()java.lang.ObjectsetValue(java.lang.Object value)java.lang.StringtoString()
-
-
-
Field Detail
-
next
protected AbstractHashedMap.HashEntry next
The next entry in the hash chain
-
hashCode
protected int hashCode
The hash code of the key
-
key
protected java.lang.Object key
The key
-
value
protected java.lang.Object value
The value
-
-
Constructor Detail
-
HashEntry
protected HashEntry(AbstractHashedMap.HashEntry next, int hashCode, java.lang.Object key, java.lang.Object value)
-
-
Method Detail
-
getKey
public java.lang.Object getKey()
Description copied from interface:KeyValueGets the key from the pair.
-
getValue
public java.lang.Object getValue()
Description copied from interface:KeyValueGets the value from the pair.
-
setValue
public java.lang.Object setValue(java.lang.Object value)
- Specified by:
setValuein interfacejava.util.Map.Entry
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.util.Map.Entry- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Map.Entry- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-