Package EDU.oswego.cs.dl.util.concurrent
Class ConcurrentHashMap.Entry
- java.lang.Object
-
- EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.Entry
-
- All Implemented Interfaces:
Map.Entry
- Enclosing class:
- ConcurrentHashMap
protected static class ConcurrentHashMap.Entry extends Object implements Map.Entry
ConcurrentHashMap collision list entry.
-
-
Field Detail
-
key
protected final Object key
-
value
protected volatile Object value
-
hash
protected final int hash
-
next
protected final ConcurrentHashMap.Entry next
-
-
Method Detail
-
getValue
public Object getValue()
Get the value. Note: In an entrySet or entrySet.iterator, unless you can guarantee lack of concurrent modification, getValue might return null, reflecting the fact that the entry has been concurrently removed. However, there are no assurances that concurrent removals will be reflected using this method.
-
setValue
public Object setValue(Object value)
Set the value of this entry. Note: In an entrySet or entrySet.iterator), unless you can guarantee lack of concurrent modification, setValue is not strictly guaranteed to actually replace the value field obtained via the get operation of the underlying hash table in multithreaded applications. If iterator-wide synchronization is not used, and any other concurrent put or remove operations occur, sometimes even to other entries, then this change is not guaranteed to be reflected in the hash table. (It might, or it might not. There are no assurances either way.)- Specified by:
setValue
in interfaceMap.Entry
- Parameters:
value
- the new value.- Returns:
- the previous value, or null if entry has been detectably removed.
- Throws:
NullPointerException
- if the value isnull
.
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
-