Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.util
Class KeyValueArrayMap

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.AbstractKeyBasedMap
          extended by com.tangosol.util.KeyValueArrayMap

All Implemented Interfaces:
java.util.Map

public class KeyValueArrayMap
extends AbstractKeyBasedMap

KeyValueArrayMap is a Map implementation backed by an array of keys, and an array of the associated values.

This implementation:

Since:
Coherence 12.1.2
Author:
rhl 2011.12.20

Nested Class Summary

 

Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeyBasedMap
AbstractKeyBasedMap.EntrySet, AbstractKeyBasedMap.KeySet, AbstractKeyBasedMap.ValuesCollection

 

Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry

 

Field Summary
protected  java.lang.Object[] m_aoKey
          The array containing map keys.
protected  java.lang.Object[] m_aoValue
          The array containing map values.
protected  int m_cSize
          The number of map entries.
protected  int m_iKey
          The index into the key array of the first key.
protected  int m_iValue
          The index into the value array of the first value.

 

Constructor Summary
KeyValueArrayMap(java.lang.Object[] aoKey, int iKey, java.lang.Object[] aoValue, int iValue, int cSize)
          Construct a KeyValueArrayMap backed by ranges of the specified key and value arrays.
KeyValueArrayMap(java.lang.Object[] aoKey, java.lang.Object[] aoValue)
          Construct a KeyValueArrayMap backed by the specified key and value arrays.

 

Method Summary
 java.lang.Object get(java.lang.Object oKey)
          Returns the value to which this map maps the specified key.
protected  java.util.Iterator iterateKeys()
          Create an iterator over the keys in this Map.
 int size()
          Returns the number of key-value mappings in this map.

 

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

 

Field Detail

m_aoKey

protected java.lang.Object[] m_aoKey
The array containing map keys.

m_aoValue

protected java.lang.Object[] m_aoValue
The array containing map values.

m_iKey

protected int m_iKey
The index into the key array of the first key.

m_iValue

protected int m_iValue
The index into the value array of the first value.

m_cSize

protected int m_cSize
The number of map entries.

Constructor Detail

KeyValueArrayMap

public KeyValueArrayMap(java.lang.Object[] aoKey,
                        java.lang.Object[] aoValue)
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 keys
aoValue - the array of values

KeyValueArrayMap

public KeyValueArrayMap(java.lang.Object[] aoKey,
                        int iKey,
                        java.lang.Object[] aoValue,
                        int iValue,
                        int cSize)
Construct a KeyValueArrayMap backed by ranges of the specified key and value arrays.
Parameters:
aoKey - the array of keys
iKey - the index of the first key
aoValue - the array of values
iValue - the index of the first value
cSize - the number of entries

Method Detail

get

public java.lang.Object get(java.lang.Object oKey)
Returns the value to which this map maps the specified key.
Specified by:
get in interface java.util.Map
Specified by:
get in class AbstractKeyBasedMap
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

protected java.util.Iterator iterateKeys()
Create an iterator over the keys in this Map. The Iterator must support remove() if the Map supports removal.
Specified by:
iterateKeys in class AbstractKeyBasedMap
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 interface java.util.Map
Overrides:
size in class AbstractKeyBasedMap
Returns:
the number of key-value mappings in this map

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.