public static class CacheStoreMap.ReadWriteMap extends AbstractKeyBasedMap
AbstractKeyBasedMap.DeferredCacheEvent<K,V>, AbstractKeyBasedMap.EntrySet, AbstractKeyBasedMap.KeySet, AbstractKeyBasedMap.ValuesCollection
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_fBlind
True means that put() and remove() can return null, regardless of
the presence of an old value.
|
protected boolean |
m_fEraseUnsupported
True means that a call to the CacheStore erase() method is assumed
to be unsupported.
|
protected boolean |
m_fStoreUnsupported
True means that a call to the CacheStore store() method is assumed
to be unsupported.
|
protected CacheStore |
m_store
The CacheStore to delegate all Map operations to.
|
Constructor and Description |
---|
ReadWriteMap(CacheStore store,
boolean fBlind)
Construct a read/write CacheStoreMap.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear is explicitly not implemented.
|
boolean |
containsKey(Object oKey)
Returns true if this map contains a mapping for the specified
key.
|
Object |
get(Object oKey)
Returns the value to which this map maps the specified key.
|
Map |
getAll(Collection colKeys)
Get all the specified keys, if they are in the Map.
|
protected boolean |
isBlindPutAllowed()
Determine if the "blind put" optimization is possible.
|
protected boolean |
isBlindRemoveAllowed()
Determine if the "blind remove" optimization is possible.
|
protected boolean |
isEraseUnsupported()
Determine if the CacheStore has been determined to be read-only for
erase() operations.
|
protected boolean |
isStoreUnsupported()
Determine if the CacheStore has been determined to be read-only for
store() operations.
|
protected Iterator |
iterateKeys()
Create an iterator over the keys in this Map.
|
Object |
put(Object oKey,
Object oValue)
Associates the specified value with the specified key in this map.
|
void |
putAll(Map map)
Copies all of the mappings from the specified map to this map.
|
Object |
remove(Object oKey)
Removes the mapping for this key from this map if present.
|
protected boolean |
removeBlind(Object oKey)
Removes the mapping for this key from this map if present.
|
clone, containsValue, entrySet, equals, hashCode, instantiateEntrySet, instantiateKeySet, instantiateValues, isEmpty, keySet, size, toString, values
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected CacheStore m_store
protected boolean m_fBlind
protected boolean m_fStoreUnsupported
protected boolean m_fEraseUnsupported
public ReadWriteMap(CacheStore store, boolean fBlind)
store
- the CacheStore to delegate read and write operations
tofBlind
- pass true to optimize put() and remove() by allowing
them to skip the loading of old valuespublic void clear()
clear
in interface Map
clear
in class AbstractKeyBasedMap
public boolean containsKey(Object oKey)
containsKey
in interface Map
containsKey
in class AbstractKeyBasedMap
public Object get(Object oKey)
get
in interface Map
get
in class AbstractKeyBasedMap
oKey
- the key objectpublic Map getAll(Collection colKeys)
getAll
in class AbstractKeyBasedMap
colKeys
- a collection of keys that may be in the named cacheprotected Iterator iterateKeys()
iterateKeys
in class AbstractKeyBasedMap
public Object put(Object oKey, Object oValue)
put
in interface Map
put
in class AbstractKeyBasedMap
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified keypublic void putAll(Map map)
AbstractKeyBasedMap.put(K, V)
on this map once for each mapping in the passed map. The behavior of
this operation is unspecified if the passed map is modified while the
operation is in progress.putAll
in interface Map
putAll
in class AbstractKeyBasedMap
map
- the Map containing the key/value pairings to put into this
Mappublic Object remove(Object oKey)
remove
in interface Map
remove
in class AbstractKeyBasedMap
oKey
- key whose mapping is to be removed from the mapprotected boolean removeBlind(Object oKey)
removeBlind
in class AbstractKeyBasedMap
oKey
- key whose mapping is to be removed from the mapprotected boolean isBlindPutAllowed()
protected boolean isBlindRemoveAllowed()
protected boolean isStoreUnsupported()
protected boolean isEraseUnsupported()