public abstract class AbstractKeySetBasedMap<K,V> extends AbstractKeyBasedMap<K,V>
Read-only implementations must implement getInternalKeySet()
and
AbstractKeyBasedMap.get(Object)
. Read/write implementations must additionally
implement AbstractKeyBasedMap.put(Object, Object)
and AbstractKeyBasedMap.remove(Object)
. If the
implementation has any cost of returning an "old value", such as is done
by the Map.put(K, V)
and Map.remove(Object)
,
then the AbstractKeyBasedMap.putAll(java.util.Map)
and AbstractKeyBasedMap.removeBlind(Object)
methods should also be implemented. The only other obvious method for
optimization is AbstractKeyBasedMap.clear()
, if the implementation is able to do it
in bulk.
Modifier and Type | Class and Description |
---|---|
class |
AbstractKeySetBasedMap.EntrySet
A set of entries backed by this map.
|
class |
AbstractKeySetBasedMap.KeyIterator
An iterator over the keys from the internal key Set that implements
element removal via the Map's removeBlind method.
|
protected class |
AbstractKeySetBasedMap.KeySet
A set of keys backed by this map.
|
protected class |
AbstractKeySetBasedMap.ValuesCollection
A Collection of values backed by this map.
|
AbstractKeyBasedMap.DeferredCacheEvent<K,V>
Base.LoggingWriter, Base.StackFrame
Constructor and Description |
---|
AbstractKeySetBasedMap() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object oKey)
Returns true if this map contains a mapping for the specified
key.
|
protected abstract Set<K> |
getInternalKeySet()
Obtain a set of keys that are represented by this Map.
|
protected Set<Map.Entry<K,V>> |
instantiateEntrySet()
Factory pattern: Create a Set that represents the entries in the Map.
|
protected Iterator<K> |
instantiateKeyIterator()
Factory pattern: Create a mutable Iterator over the keys in the Map
|
protected Set<K> |
instantiateKeySet()
Factory pattern: Create a Set that represents the keys in the Map
|
protected Collection<V> |
instantiateValues()
Factory pattern: Instantiate the values Collection.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
protected boolean |
isInternalKeySetIteratorMutable()
Determine if this Iterator should remove an iterated item by calling
remove on the internal key Set Iterator, or by calling removeBlind on
the map itself.
|
protected Iterator<K> |
iterateKeys()
Create an iterator over the keys in this Map.
|
int |
size()
Returns the number of key-value mappings in this map.
|
clear, clone, containsValue, entrySet, equals, get, getAll, hashCode, keySet, put, putAll, remove, removeBlind, 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, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, 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
public boolean containsKey(Object oKey)
containsKey
in interface Map<K,V>
containsKey
in class AbstractKeyBasedMap<K,V>
public boolean isEmpty()
public int size()
protected Iterator<K> iterateKeys()
iterateKeys
in class AbstractKeyBasedMap<K,V>
protected abstract Set<K> getInternalKeySet()
The AbstractKeySetBasedMap only utilizes the internal key set as a read-only resource.
protected boolean isInternalKeySetIteratorMutable()
AbstractKeyBasedMap.removeBlind(Object)
methodprotected Set<K> instantiateKeySet()
instantiateKeySet
in class AbstractKeyBasedMap<K,V>
protected Set<Map.Entry<K,V>> instantiateEntrySet()
instantiateEntrySet
in class AbstractKeyBasedMap<K,V>
protected Collection<V> instantiateValues()
instantiateValues
in class AbstractKeyBasedMap<K,V>