Show / Hide Table of Contents

Class ConditionalProcessor

Conditional entry processor represents a processor that is invoked conditionally based on the result of an entry evaluation.

Inheritance
object
AbstractProcessor
ConditionalProcessor
Implements
IEntryProcessor
IPortableObject
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Util.Processor
Assembly: Coherence.dll
Syntax
public class ConditionalProcessor : AbstractProcessor, IEntryProcessor, IPortableObject
Remarks

If the underlying filter expects to evaluate existent entries only (i.e. entries for which IsPresent is true, it should be combined with a PresentFilter as follows:

IFilter filterPresent = new AndFilter(new PresentFilter(), filter);

Constructors

ConditionalProcessor()

Default constructor.

Declaration
public ConditionalProcessor()

ConditionalProcessor(IFilter, IEntryProcessor)

Construct a ConditionalProcessor for the specified filter and the processor.

Declaration
public ConditionalProcessor(IFilter filter, IEntryProcessor processor)
Parameters
Type Name Description
IFilter filter

The filter.

IEntryProcessor processor

The entry processor.

Remarks

The specified entry processor gets invoked if and only if the filter applied to the IInvocableCacheEntry evaluates to true; otherwize the result of the Process(IInvocableCacheEntry) invocation will return null.

Fields

m_filter

The underlying filter.

Declaration
protected IFilter m_filter
Field Value
Type Description
IFilter

m_processor

The underlying entry processor.

Declaration
protected IEntryProcessor m_processor
Field Value
Type Description
IEntryProcessor

Methods

Equals(object)

Compare the ConditionalProcessor with another object to determine equality.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
object o

The object to compare with.

Returns
Type Description
bool

true iff this ConditionalProcessor and the passed object are equivalent ConditionalProcessors.

Overrides
object.Equals(object)

GetHashCode()

Determine a hash value for the ConditionalProcessor object according to the general GetHashCode() contract.

Declaration
public override int GetHashCode()
Returns
Type Description
int

An integer hash value for this ConditionalProcessor object.

Overrides
object.GetHashCode()

Process(IInvocableCacheEntry)

Process an IInvocableCacheEntry.

Declaration
public override object Process(IInvocableCacheEntry entry)
Parameters
Type Name Description
IInvocableCacheEntry entry

The IInvocableCacheEntry to process.

Returns
Type Description
object

The result of the processing, if any.

Overrides
AbstractProcessor.Process(IInvocableCacheEntry)

ProcessAll(ICollection)

Process a collection of IInvocableCacheEntry objects.

Declaration
public override IDictionary ProcessAll(ICollection entries)
Parameters
Type Name Description
ICollection entries

A read-only collection of IInvocableCacheEntry objects to process.

Returns
Type Description
IDictionary

A dictionary containing the results of the processing, up to one entry for each IInvocableCacheEntry that was processed, keyed by the keys of the dictionary that were processed, with a corresponding value being the result of the processing for each key.

Overrides
AbstractProcessor.ProcessAll(ICollection)

ReadExternal(IPofReader)

Restore the contents of a user type instance by reading its state using the specified IPofReader object.

Declaration
public virtual void ReadExternal(IPofReader reader)
Parameters
Type Name Description
IPofReader reader

The IPofReader from which to read the object's state.

Exceptions
Type Condition
IOException

If an I/O error occurs.

ToString()

Return a human-readable description for this ConditionalProcessor.

Declaration
public override string ToString()
Returns
Type Description
string

A String description of the ConditionalProcessor.

Overrides
object.ToString()

WriteExternal(IPofWriter)

Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.

Declaration
public virtual void WriteExternal(IPofWriter writer)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter to which to write the object's state.

Exceptions
Type Condition
IOException

If an I/O error occurs.

Implements

IEntryProcessor
IPortableObject

See Also

PresentFilter
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.