Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

MapIndex Class Reference

#include <coherence/util/MapIndex.hpp>

Inherits Object.

Inherited by SimpleMapIndex [virtual].

List of all members.


Detailed Description

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:
tb 2009.02.09

Public Types

typedef spec::Handle Handle
 MapIndex Handle definition.
typedef spec::View View
 MapIndex View definition.
typedef spec::Holder Holder
 MapIndex Holder definition.

Public Member Functions

virtual
ValueExtractor::View 
getValueExtractor () const =0
 Obtain the ValueExtractor object that the MapIndex uses to extract an indexable Object from a value stored in the indexed Map.
virtual bool isOrdered () const =0
 Determine if the MapIndex orders the contents of the indexed information.
virtual bool isPartial () const =0
 Determine if indexed information for any entry in the indexed Map has been excluded from this index.
virtual Map::View getIndexContents () const =0
 Get the Map that contains the index contents.
virtual Object::Holder get (Object::View vKey) const =0
 Using the index information if possible, get the value associated with the specified key.
virtual Object::Holder get (Object::View vKey)=0
 Using the index information if possible, get the value associated with the specified key.
virtual Comparator::View getComparator () const =0
 Get the Comparator used to sort the index.
virtual void insert (Map::Entry::View vEntry)=0
 Update the index in response to a insert operation on a cache.
virtual void update (Map::Entry::View vEntry)=0
 Update the index in response to an update operation on a cache.
virtual void remove (Map::Entry::View vEntry)=0
 Update the index in response to a remove operation on a cache.

Static Public Member Functions

static Object::View getNoValue ()
 Constant used to indicate that the index does not contain requested value.

Member Function Documentation

virtual ValueExtractor::View getValueExtractor (  )  const [pure virtual]

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

Implemented in SimpleMapIndex.

virtual bool isOrdered (  )  const [pure virtual]

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

Implemented in SimpleMapIndex.

virtual bool isPartial (  )  const [pure virtual]

Determine if indexed information for any entry in the indexed Map has been excluded from this index.

This information is used for IndexAwareFilter implementations to determine the most optimal way to apply the index.

Returns:
true if any entry of the indexed Map has been excluded from the index, false otherwise
Since:
Coherence 3.6

Implemented in ConditionalIndex, and SimpleMapIndex.

virtual Map::View getIndexContents (  )  const [pure virtual]

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.

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

Implemented in SimpleMapIndex.

virtual Object::Holder get ( Object::View  vKey  )  const [pure virtual]

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:
vKey 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; getNoValue() if the index does not have the necessary information

Implemented in ConditionalIndex, and SimpleMapIndex.

virtual Object::Holder get ( Object::View  vKey  )  [pure virtual]

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

Implemented in ConditionalIndex, and SimpleMapIndex.

virtual Comparator::View getComparator (  )  const [pure virtual]

Get the Comparator used to sort the index.

Returns:
the comparator
Since:
Coherence 3.5

Implemented in SimpleMapIndex.

virtual void insert ( Map::Entry::View  vEntry  )  [pure virtual]

Update the index in response to a insert operation on a cache.

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

Implemented in SimpleMapIndex.

virtual void update ( Map::Entry::View  vEntry  )  [pure virtual]

Update the index in response to an update operation on a cache.

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

Implemented in SimpleMapIndex.

virtual void remove ( Map::Entry::View  vEntry  )  [pure virtual]

Update the index in response to a remove operation on a cache.

Parameters:
vEntry the entry representing the object being deleted
Since:
Coherence 3.5

Implemented in SimpleMapIndex.

static Object::View getNoValue (  )  [static]

Constant used to indicate that the index does not contain requested value.

Returns:
a constant used to indicate that the index does not contain requested value.
Since:
Coherence 3.6.1


The documentation for this class was generated from the following file:
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.