QueryMap Class Reference

#include <coherence/util/QueryMap.hpp>

Inherits Map.

Inherited by NamedCache [virtual], and ConverterCollections::ConverterQueryMap [virtual].

List of all members.


Detailed Description

Map with additional query features.

Author:
jh 2008.02.27

Public Types

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

Public Member Functions

virtual Set::View keySet (Filter::View vFilter) const =0
 Return a set of the keys contained in this map for entries that satisfy the criteria expressed by the filter.
virtual Set::View entrySet (Filter::View vFilter) const =0
 Return a set of the entries contained in this map that satisfy the criteria expressed by the filter.
virtual Set::View entrySet (Filter::View vFilter, Comparator::View vComparator) const =0
 Return a set of the entries contained in this map that satisfy the criteria expressed by the filter.
virtual void addIndex (ValueExtractor::View vExtractor, bool fOrdered, Comparator::View vComparator)=0
 Add an index to this QueryMap.
virtual void removeIndex (ValueExtractor::View vExtractor)=0
 Remove an index from this QueryMap.

Classes

class  Entry
 A QueryMap::Entry exposes additional index-related operation that the basic Map::Entry does not. More...

Member Function Documentation

virtual Set::View keySet ( Filter::View  vFilter  )  const [pure virtual]

Return a set of the keys contained in this map for entries that satisfy the criteria expressed by the filter.

Unlike the Map#keySet() method, the set returned by this method may not be backed by the map, so changes to the set may not reflected in the map, and vice-versa.

Parameters:
vFilter the Filter object representing the criteria that the entries of this map should satisfy
Returns:
a set of keys for entries that satisfy the specified criteria

Implemented in ConverterCollections::ConverterQueryMap, and ConverterCollections::ConverterNamedCache.

virtual Set::View entrySet ( Filter::View  vFilter  )  const [pure virtual]

Return a set of the entries contained in this map that satisfy the criteria expressed by the filter.

Each element in the returned set is a Map::Entry.

Unlike the Map::entrySet() method, the set returned by this method may not be backed by the map, so changes to the set may not be reflected in the map, and vice-versa.

Parameters:
vFilter the Filter object representing the criteria that the entries of this map should satisfy
Returns:
a set of entries that satisfy the specified criteria

Implemented in ConverterCollections::ConverterQueryMap, and ConverterCollections::ConverterNamedCache.

virtual Set::View entrySet ( Filter::View  vFilter,
Comparator::View  vComparator 
) const [pure virtual]

Return a set of the entries contained in this map that satisfy the criteria expressed by the filter.

Each element in the returned set is a Map::Entry. It is further guaranteed that its iterator will traverse the set in such a way that the entry values come up in ascending order, sorted by the specified Comparator or according to the natural ordering (see Comparable).

Unlike the Map::entrySet() method, the set returned by this method may not be backed by the map, so changes to the set may not be reflected in the map, and vice-versa.

Parameters:
vFilter the Filter object representing the criteria that the entries of this map should satisfy
vComparator the Comparator object which imposes an ordering on entries in the resulting set; or NULL if the entries' values natural ordering should be used
Returns:
a set of entries that satisfy the specified criteria

Implemented in ConverterCollections::ConverterQueryMap, and ConverterCollections::ConverterNamedCache.

virtual void addIndex ( ValueExtractor::View  vExtractor,
bool  fOrdered,
Comparator::View  vComparator 
) [pure virtual]

Add an index to this QueryMap.

This allows to correlate values stored in this indexed Map (or attributes of those values) to the corresponding keys in the indexed Map and increase the performance of keySet and entrySet methods.

This method is only intended as a hint to the cache implementation, and as such it may be ignored by the cache if indexes are not supported or if the desired index (or a similar index) already exists. It is expected that an application will call this method to suggest an index even if the index may already exist, just so that the application is certain that index has been suggested. For example in a distributed environment, each server will likely suggest the same set of indexes when it starts, and there is no downside to the application blindly requesting those indexes regardless of whether another server has already requested the same indexes.

Parameters:
vExtractor the ValueExtractor object that is used to extract an indexable Object from a value stored in the indexed Map. Must not be NULL.
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 indexed map; or NULL if the entries' values natural ordering should be used

Implemented in ConverterCollections::ConverterQueryMap, and ConverterCollections::ConverterNamedCache.

virtual void removeIndex ( ValueExtractor::View  vExtractor  )  [pure virtual]

Remove an index from this QueryMap.

Parameters:
vExtractor the ValueExtractor object that is used to extract an indexable Object from a value stored in the Map

Implemented in ConverterCollections::ConverterQueryMap, and ConverterCollections::ConverterNamedCache.


The documentation for this class was generated from the following file: Copyright (c) 2000-2008 Oracle. All rights reserved.