Oracle® Coherence Java API Reference
v3.5.3

E15583-01

com.tangosol.util
Interface MapIndex

All Known Implementing Classes:
SimpleMapIndex

public interface MapIndex

MapIndex is used to correlate values stored in an indexed Map (or attributes of those values) to the corresponding keys in the indexed Map.

Author:
cp/gg 2002.10.31

Method Summary
 void delete(java.util.Map.Entry entry)
          Update this index in response to a remove operation on a cache.
 java.lang.Object get(java.lang.Object oKey)
          Using the index information if possible, get the value associated with the specified key.
 java.util.Comparator getComparator()
          Get the Comparator used to sort the index.
 java.util.Map getIndexContents()
          Get the Map that contains the index contents.
 ValueExtractor getValueExtractor()
          Obtain the ValueExtractor object that the MapIndex uses to extract an indexable Object from a value stored in the indexed Map.
 void insert(java.util.Map.Entry entry)
          Update this index in response to a insert operation on a cache.
 boolean isOrdered()
          Determine if the MapIndex orders the contents of the indexed information.
 void update(java.util.Map.Entry entry)
          Update this index in response to an update operation on a cache.
 

Method Detail

getValueExtractor

ValueExtractor getValueExtractor()
Obtain the ValueExtractor object that the MapIndex uses to extract an indexable Object from a value stored in the indexed Map. This property is never null.

Returns:
a ValueExtractor object, never null

isOrdered

boolean isOrdered()
Determine if the MapIndex orders the contents of the indexed information. To determine in which way the contents are ordered, get the Comparator from the index contents SortedMap object.

Returns:
true if the index contents are ordered, false otherwise

getIndexContents

java.util.Map getIndexContents()
Get the Map that contains the index contents.

The keys of the Map are the return values from the ValueExtractor operating against the indexed Map's values, and for each key, the corresponding value stored in the Map is a Set of keys to the indexed Map.

If the MapIndex is known to be ordered, then the returned Map object will be an instance of SortedMap. The SortedMap may or may not have a Comparator object associated with it; see SortedMap.comparator().

A client should assume that the returned Map object is read-only and must not attempt to modify it.

Returns:
a Map (or a SortedMap) of the index contents

get

java.lang.Object get(java.lang.Object oKey)
Using the index information if possible, get the value associated with the specified key. This is expected to be more efficient than using the ValueExtractor against an object containing the value, because the index should already have the necessary information at hand.

Parameters:
oKey - the key that specifies the object to extract the value from
Returns:
the value that would be extracted by this MapIndex's ValueExtractor from the object specified by the passed key

getComparator

java.util.Comparator getComparator()
Get the Comparator used to sort the index.

Returns:
the comparator
Since:
Coherence 3.5

insert

void insert(java.util.Map.Entry entry)
Update this index in response to a insert operation on a cache.

Parameters:
entry - the entry representing the object being inserted
Since:
Coherence 3.5

update

void update(java.util.Map.Entry entry)
Update this index in response to an update operation on a cache.

Parameters:
entry - the entry representing the object being updated
Since:
Coherence 3.5

delete

void delete(java.util.Map.Entry entry)
Update this index in response to a remove operation on a cache.

Parameters:
entry - the entry representing the object being removed
Since:
Coherence 3.5

Oracle® Coherence Java API Reference
v3.5.3

E15583-01

Copyright © 2000, 2010, Oracle. All rights reserved.