#include <coherence/util/ConditionalIndex.hpp>
Inherits SimpleMapIndex.
An entry's extracted value is only added to the index if the filter evaluates to true.
Public Types | ||||
typedef spec::Handle | Handle | |||
ConditionalIndex Handle definition. | ||||
typedef spec::View | View | |||
ConditionalIndex View definition. | ||||
typedef spec::Holder | Holder | |||
ConditionalIndex Holder definition. | ||||
Public Member Functions | ||||
virtual Object::Holder | get (Object::View vKey) const | |||
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.
| ||||
virtual Object::Holder | get (Object::View vKey) | |||
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.
| ||||
virtual bool | isPartial () const | |||
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.
| ||||
Filter::View | getFilter () const | |||
Get the associated filter. | ||||
bool | isForwardIndexSupported () const | |||
Determine whether or not this ConditionalIndex supports a forward index. | ||||
virtual TypedHandle < const String > | toString () const | |||
Writes a string representation of this ConditionalIndex to the stream. | ||||
virtual bool | equals (Object::View v) const | |||
Compares the specified object with this index for equality. | ||||
Protected Member Functions | ||||
ConditionalIndex (Filter::View vFilter, ValueExtractor::View vExtractor, bool fOrdered, Comparator::View vComparator, bool fForwardIndex) | ||||
Construct a ConditionalIndex. | ||||
virtual Map::Entry::View | getForwardEntry (Object::View vKey) const | |||
Get the forward index entry associated with the specified key.
| ||||
virtual Map::Entry::Handle | getForwardEntry (Object::View vKey) | |||
Get the forward index entry associated with the specified key.
| ||||
virtual void | removeForwardEntry (Object::View vKey) | |||
Remove the forward index entry for the specified key.
| ||||
Map::Handle | instantiateForwardIndex () const | |||
Instantiate and initialize the forward index. Note: To optimize the memory footprint of the forward index, any subclasses of the SimpleMapIndex that override this method must also implement the getForwardEntry(Object) method accordingly.
| ||||
bool | evaluateEntry (Map::Entry::View vEntry) | |||
Evaluate the given entry using this index's filter. | ||||
virtual void | insertInternal (Map::Entry::View vEntry) | |||
Update this index in response to a insert operation on a cache.
| ||||
virtual void | updateInternal (Map::Entry::View vEntry) | |||
Update this index in response to an update operation on a cache.
| ||||
virtual void | removeInternal (Map::Entry::View vEntry) | |||
Update this index in response to a remove operation on a cache.
|
ConditionalIndex | ( | Filter::View | vFilter, | |
ValueExtractor::View | vExtractor, | |||
bool | fOrdered, | |||
Comparator::View | vComparator, | |||
bool | fForwardIndex | |||
) | [protected] |
Construct a ConditionalIndex.
vFilter | the filter that is used to evaluate the entries of the resource map that is being indexed | |
vExtractor | the coherence::util::ValueExtractor that is used to extract an indexed value from a resource map entry | |
fOrdered | true iff the contents of the indexed information should be ordered; false otherwise | |
vComparator | the Comparator object which imposes an ordering on entries in the index map; or null if the entries' values natural ordering should be used | |
fForwardIndex | specifies whether or not this index supports a forward map |
Filter::View getFilter | ( | ) | const |
bool isForwardIndexSupported | ( | ) | const |
Determine whether or not this ConditionalIndex supports a forward index.
bool evaluateEntry | ( | Map::Entry::View | vEntry | ) | [protected] |
virtual TypedHandle<const String> toString | ( | ) | const [virtual] |
Writes a string representation of this ConditionalIndex to the stream.
The string representation consists of the SimpleMapIndex representaion concatenated by the Filter and the ForwardIndexSupported flag.
Reimplemented from SimpleMapIndex.
virtual bool equals | ( | Object::View | v | ) | const [virtual] |
Compares the specified object with this index for equality.
Returns true
if the given object is also a SimpleMapIndex and the two represent the same index.
o | object to be compared for equality with this MapIndex |
true
if the specified object is equal to this index Reimplemented from SimpleMapIndex.