|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.SimpleMapIndex
com.tangosol.util.ConditionalIndex
public class ConditionalIndex
ConditionalIndex is a MapIndex
implementation that uses an associated filter to evaluate whether or not an entry should be indexed. An entry's extracted value is only added to the index if the filter evaluates to true.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.tangosol.util.SimpleMapIndex |
---|
SimpleMapIndex.IndexCalculator |
Field Summary |
---|
Fields inherited from class com.tangosol.util.SimpleMapIndex |
---|
m_calculator, m_cLogMissingIdx, m_comparator, m_ctx, m_cUnits, m_extractor, m_fForwardIndex, m_fOrdered, m_fSplitCollection, m_ldtLogMissingIdx, m_mapForward, m_mapInverse, m_setKeyExcluded |
Fields inherited from interface com.tangosol.util.MapIndex |
---|
NO_VALUE |
Constructor Summary | |
---|---|
ConditionalIndex(Filter filter, ValueExtractor extractor, boolean fOrdered, java.util.Comparator comparator, boolean fForwardIndex, BackingMapContext ctx) Construct a ConditionalIndex. |
Method Summary | |
---|---|
protected void |
deleteInternal(java.util.Map.Entry entry) Update this index in response to a remove operation on a cache. |
boolean |
equals(java.lang.Object o) Compares the specified object with this index for equality. |
protected boolean |
evaluateEntry(java.util.Map.Entry entry) Evaluate the given entry using this index's filter. |
java.lang.Object |
get(java.lang.Object oKey) Using the index information if possible, get the value associated with the specified key. |
Filter |
getFilter() Get the associated filter. |
protected java.util.Map.Entry |
getForwardEntry(java.lang.Object oKey) Get the forward index entry associated with the specified key. |
protected void |
insertInternal(java.util.Map.Entry entry) Update this index in response to a insert operation on a cache. |
protected java.util.Map |
instantiateForwardIndex() Instantiate the forward index. |
boolean |
isPartial() Determine if indexed information for any entry in the indexed Map has been excluded from this index. |
protected void |
removeForwardEntry(java.lang.Object oKey) Remove the forward index entry for the specified key. |
java.lang.String |
toString() Returns a string representation of this ConditionalIndex. |
protected void |
updateInternal(java.util.Map.Entry entry) Update this index in response to an update operation on a cache. |
Constructor Detail |
---|
public ConditionalIndex(Filter filter, ValueExtractor extractor, boolean fOrdered, java.util.Comparator comparator, boolean fForwardIndex, BackingMapContext ctx)
filter
- the filter that is used to evaluate the entries of the resource map that is being indexedextractor
- the ValueExtractor
that is used to extract an indexed value from a resource map entryfOrdered
- true iff the contents of the indexed information should be ordered; false otherwisecomparator
- the Comparator object which imposes an ordering on entries in the index map; or null if the entries' values natural ordering should be usedfForwardIndex
- specifies whether or not this index supports a forward mapctx
- the context
associated with this indexMethod Detail |
---|
public java.lang.Object get(java.lang.Object oKey)
get
in interface MapIndex
get
in class SimpleMapIndex
oKey
- the key that specifies the object to extract the value fromprotected java.util.Map.Entry getForwardEntry(java.lang.Object oKey)
getForwardEntry
in class SimpleMapIndex
oKey
- the keyprotected void removeForwardEntry(java.lang.Object oKey)
removeForwardEntry
in class SimpleMapIndex
oKey
- the key to remove the forward index entry forprotected java.util.Map instantiateForwardIndex()
Note: To optimize the memory footprint of the forward index, any subclasses of the SimpleMapIndex that override this method must also implement the SimpleMapIndex.getForwardEntry(Object)
method accordingly.
instantiateForwardIndex
in class SimpleMapIndex
public boolean isPartial()
IndexAwareFilter
implementations to determine the most optimal way to apply the index.
Note: Queries that use a partial index are allowed not to return entries that are not indexed even though they would match the corresponding filter were they evaluated during the full scan (if there were no index). However, it's not allowable for a query to return entries that do not match the corresponding filter, regardless of their presence in the index.
isPartial
in interface MapIndex
isPartial
in class SimpleMapIndex
public Filter getFilter()
protected boolean evaluateEntry(java.util.Map.Entry entry)
entry
- the entry to evaluateprotected void insertInternal(java.util.Map.Entry entry)
insertInternal
in class SimpleMapIndex
entry
- the entry representing the object being insertedprotected void updateInternal(java.util.Map.Entry entry)
updateInternal
in class SimpleMapIndex
entry
- the entry representing the object being updatedprotected void deleteInternal(java.util.Map.Entry entry)
deleteInternal
in class SimpleMapIndex
entry
- the entry representing the object being removedpublic java.lang.String toString()
toString
in class SimpleMapIndex
public boolean equals(java.lang.Object o)
equals
in class SimpleMapIndex
o
- object to be compared for equality with this MapIndex
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |