|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.SafeHashMap.Entry
protected static class SafeHashMap.Entry
A map entry (key-value pair). The Map.entrySet method returns a collection-view of the map, whose elements are of this class.
Field Summary | |
---|---|
protected SafeHashMap.Entry |
m_eNext
The next entry in the linked list (an open hashing implementation). |
protected int |
m_nHash
The key's hash code. |
protected Object |
m_oKey
The key. |
protected Object |
m_oValue
The value. |
Constructor Summary | |
---|---|
protected |
SafeHashMap.Entry()
|
Method Summary | |
---|---|
Object |
clone()
Clone the Entry. |
protected void |
copyFrom(SafeHashMap.Entry entry)
Copy this Entry's information from another Entry. |
boolean |
equals(Object o)
Compares the specified object with this entry for equality. |
Object |
getKey()
Returns the key corresponding to this entry. |
Object |
getValue()
Returns the value corresponding to this entry. |
int |
hashCode()
Returns the hash code value for this map entry. |
protected void |
onAdd()
This method is invoked when the containing Map has actually added this Entry to itself. |
Object |
setValue(Object value)
Replaces the value corresponding to this entry with the specified value (optional operation). |
String |
toString()
Render the map entry as a String. |
Field Detail |
---|
protected Object m_oKey
protected volatile Object m_oValue
protected int m_nHash
protected volatile SafeHashMap.Entry m_eNext
Constructor Detail |
---|
protected SafeHashMap.Entry()
Method Detail |
---|
public Object getKey()
getKey
in interface Map.Entry
public Object getValue()
getValue
in interface Map.Entry
public Object setValue(Object value)
setValue
in interface Map.Entry
value
- new value to be stored in this entry
public boolean equals(Object o)
(e1.getKey()==null ? e2.getKey()==null : e1.getKey().equals(e2.getKey())) && (e1.getValue()==null ? e2.getValue()==null : e1.getValue().equals(e2.getValue()))This ensures that the equals method works properly across different implementations of the Map.Entry interface.
equals
in interface Map.Entry
o
- object to be compared for equality with this map entry
public int hashCode()
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^ (e.getValue()==null ? 0 : e.getValue().hashCode())This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
hashCode
in interface Map.Entry
public String toString()
public Object clone()
copyFrom
.
protected void copyFrom(SafeHashMap.Entry entry)
entry
- the entry to copy fromprotected void onAdd()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |