Package com.tangosol.util
Class KeyValueArrayMap
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractKeyBasedMap
com.tangosol.util.KeyValueArrayMap
- All Implemented Interfaces:
Map
KeyValueArrayMap is a Map implementation backed by an array of keys, and an
array of the associated values.
This implementation:
- does not support updates or removals
- does not ensure the uniqueness of keys (this is the caller's responsibility)
- is not thread-safe
- Since:
- Coherence 12.1.2
- Author:
- rhl 2011.12.20
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeyBasedMap
AbstractKeyBasedMap.DeferredCacheEvent<K,
V>, AbstractKeyBasedMap.EntrySet, AbstractKeyBasedMap.KeySet, AbstractKeyBasedMap.ValuesCollection Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
Field Summary
Modifier and TypeFieldDescriptionprotected Object[]
The array containing map keys.protected Object[]
The array containing map values.protected int
The number of map entries.protected int
The index into the key array of the first key.protected int
The index into the value array of the first value. -
Constructor Summary
ConstructorDescriptionKeyValueArrayMap
(Object[] aoKey, int iKey, Object[] aoValue, int iValue, int cSize) Construct a KeyValueArrayMap backed by ranges of the specified key and value arrays.KeyValueArrayMap
(Object[] aoKey, Object[] aoValue) Construct a KeyValueArrayMap backed by the specified key and value arrays. -
Method Summary
Methods inherited from class com.tangosol.util.AbstractKeyBasedMap
clear, clone, containsKey, containsValue, entrySet, equals, getAll, hashCode, instantiateEntrySet, instantiateKeySet, instantiateValues, isEmpty, keySet, put, putAll, remove, removeBlind, toString, values
Methods inherited from class com.tangosol.util.Base
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, 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
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
m_aoKey
The array containing map keys. -
m_aoValue
The array containing map values. -
m_iKey
protected int m_iKeyThe index into the key array of the first key. -
m_iValue
protected int m_iValueThe index into the value array of the first value. -
m_cSize
protected int m_cSizeThe number of map entries.
-
-
Constructor Details
-
KeyValueArrayMap
Construct a KeyValueArrayMap backed by the specified key and value arrays. The specified arrays must be non-null and of equal length.- Parameters:
aoKey
- the array of keysaoValue
- the array of values
-
KeyValueArrayMap
Construct a KeyValueArrayMap backed by ranges of the specified key and value arrays.- Parameters:
aoKey
- the array of keysiKey
- the index of the first keyaoValue
- the array of valuesiValue
- the index of the first valuecSize
- the number of entries
-
-
Method Details
-
get
Returns the value to which this map maps the specified key.- Specified by:
get
in interfaceMap
- Specified by:
get
in classAbstractKeyBasedMap
- Parameters:
oKey
- the key object- Returns:
- the value to which this map maps the specified key, or null if the map contains no mapping for this key
-
iterateKeys
Create an iterator over the keys in this Map. The Iterator must support remove() if the Map supports removal.- Specified by:
iterateKeys
in classAbstractKeyBasedMap
- Returns:
- a new instance of an Iterator over the keys in this Map
-
size
public int size()Returns the number of key-value mappings in this map.- Specified by:
size
in interfaceMap
- Overrides:
size
in classAbstractKeyBasedMap
- Returns:
- the number of key-value mappings in this map
-