Package com.tangosol.util
Class AbstractKeySetBasedMap<K,V> 
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractKeyBasedMap<K,V>
 
com.tangosol.util.AbstractKeySetBasedMap<K,V> 
- All Implemented Interfaces:
- Map<K,- V> 
- Direct Known Subclasses:
- ContinuousQueryCache,- OverflowMap,- SerializationMap,- WrapperObservableMap
AbstractKeySetBasedMap is an extension to the AbstractKeyBasedMap that
 has a full awareness of the set of keys upon which the Map is based. As
 a result, it is possible to optimize the implementation of a number of
 methods that benefit from a knowledge of the entire set of keys.
 
 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.
- Author:
- 2005.09.20 cp
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassA set of entries backed by this map.classAn iterator over the keys from the internal key Set that implements element removal via the Map's removeBlind method.protected classA set of keys backed by this map.protected classA Collection of values backed by this map.Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeyBasedMapAbstractKeyBasedMap.DeferredCacheEvent<K,V> Nested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsKey(Object oKey) Returns true if this map contains a mapping for the specified key.Obtain a set of keys that are represented by this Map.Factory pattern: Create a Set that represents the entries in the Map.Factory pattern: Create a mutable Iterator over the keys in the MapFactory pattern: Create a Set that represents the keys in the Mapprotected Collection<V> Factory pattern: Instantiate the values Collection.booleanisEmpty()Returns true if this map contains no key-value mappings.protected booleanDetermine 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.Create an iterator over the keys in this Map.intsize()Returns the number of key-value mappings in this map.Methods inherited from class com.tangosol.util.AbstractKeyBasedMapclear, clone, containsValue, entrySet, equals, get, getAll, hashCode, keySet, put, putAll, remove, removeBlind, toString, valuesMethods inherited from class com.tangosol.util.Baseazzert, 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, 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, waitMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
- 
Constructor Details- 
AbstractKeySetBasedMappublic AbstractKeySetBasedMap()
 
- 
- 
Method Details- 
containsKeyReturns true if this map contains a mapping for the specified key.- Specified by:
- containsKeyin interface- Map<K,- V> 
- Overrides:
- containsKeyin class- AbstractKeyBasedMap<K,- V> 
- Returns:
- true if this map contains a mapping for the specified key, false otherwise.
 
- 
isEmptypublic boolean isEmpty()Returns true if this map contains no key-value mappings.
- 
sizepublic int size()Returns the number of key-value mappings in this map.
- 
iterateKeysCreate an iterator over the keys in this Map. Note that this implementation delegates back to the key Set, while the super class delegates from the key Set to this method.- Specified by:
- iterateKeysin class- AbstractKeyBasedMap<K,- V> 
- Returns:
- a new instance of an Iterator over the keys in this Map
 
- 
getInternalKeySetObtain a set of keys that are represented by this Map.The AbstractKeySetBasedMap only utilizes the internal key set as a read-only resource. - Returns:
- an internal Set of keys that are contained by this Map
 
- 
isInternalKeySetIteratorMutableprotected 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.- Returns:
- true to remove using the internal key Set Iterator or false to
         use the AbstractKeyBasedMap.removeBlind(Object)method
 
- 
instantiateKeySetFactory pattern: Create a Set that represents the keys in the Map- Overrides:
- instantiateKeySetin class- AbstractKeyBasedMap<K,- V> 
- Returns:
- a new instance of Set that represents the keys in the Map
 
- 
instantiateEntrySetFactory pattern: Create a Set that represents the entries in the Map.- Overrides:
- instantiateEntrySetin class- AbstractKeyBasedMap<K,- V> 
- Returns:
- a new instance of Set that represents the entries in the Map
 
- 
instantiateValuesFactory pattern: Instantiate the values Collection.- Overrides:
- instantiateValuesin class- AbstractKeyBasedMap<K,- V> 
- Returns:
- a new instance of Collection that represents this Map's values
 
- 
instantiateKeyIteratorFactory pattern: Create a mutable Iterator over the keys in the Map- Returns:
- a new instance of Iterator that iterates over the keys in the Map and supports element removal
 
 
-