org.compass.core.util.backport.java.util.concurrent
Class ConcurrentHashMap.WriteThroughEntry

java.lang.Object
  extended by org.compass.core.util.backport.java.util.AbstractMap.SimpleEntry
      extended by org.compass.core.util.backport.java.util.concurrent.ConcurrentHashMap.WriteThroughEntry
All Implemented Interfaces:
Map.Entry
Enclosing class:
ConcurrentHashMap

final class ConcurrentHashMap.WriteThroughEntry
extends AbstractMap.SimpleEntry

Custom Entry class used by EntryIterator.next(), that relays setValue changes to the underlying map.


Constructor Summary
ConcurrentHashMap.WriteThroughEntry(Object k, Object v)
           
 
Method Summary
 Object setValue(Object value)
          Set our entry's value and write through to the map.
 
Methods inherited from class org.compass.core.util.backport.java.util.AbstractMap.SimpleEntry
equals, getKey, getValue, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcurrentHashMap.WriteThroughEntry

ConcurrentHashMap.WriteThroughEntry(Object k,
                                    Object v)
Method Detail

setValue

public Object setValue(Object value)
Set our entry's value and write through to the map. The value to return is somewhat arbitrary here. Since a WriteThroughEntry does not necessarily track asynchronous changes, the most recent "previous" value could be different from what we return (or could even have been removed in which case the put will re-establish). We do not and cannot guarantee more.

Specified by:
setValue in interface Map.Entry
Overrides:
setValue in class AbstractMap.SimpleEntry
Parameters:
value - new value to be stored in this entry
Returns:
the old value corresponding to the entry


Copyright (c) 2004-2006 The Compass Project.