Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MapEventFilter<K, V>

Filter which evaluates the content of a MapEvent object according to the specified criteria. This filter is intended to be used by various map listeners that are interested in particular subsets of MapEvent notifications emitted by the map.

Type parameters

  • K

  • V

Hierarchy

Index

Constructors

constructor

  • Construct a MapEventFilter that evaluates MapEvent objects based on the specified combination of event types.

    Parameters

    • maskOrFilter: number | Filter

      combination of any of the E_* values or the filter passed previously to a keySet() query method

    • Optional filter: Filter

      the filter used for evaluating event values

    Returns MapEventFilter

Properties

@class

@class: string

Server-side Filter implementation type identifier.

Optional filter

filter: Filter | undefined | null

The event value(s) filter.

mask

mask: number

The event mask.

Static ALL

ALL: number = MapEventFilter.INSERTED | MapEventFilter.UPDATED |MapEventFilter.DELETED

This value indicates that all events should be evaluated.

Static DELETED

DELETED: number = 4

This value indicates that delete events should be evaluated. The event will be fired if there is no filter specified or the filter evaluates to true for an old value.

Static INSERTED

INSERTED: number = 1

This value indicates that insert events should be evaluated. The event will be fired if there is no filter specified or the filter evaluates to true for a new value.

Static KEYSET

KEYSET: number = MapEventFilter.INSERTED | MapEventFilter.DELETED |MapEventFilter.UPDATED_ENTERED | MapEventFilter.UPDATED_LEFT

This value indicates that all events that would affect the result of a NamedMap.keySet(Filter) query should be evaluated.

since

Coherence 3.1

Static UPDATED

UPDATED: number = 2

This value indicates that update events should be evaluated. The event will be fired if there is no filter specified or the filter evaluates to true when applied to either old or new value.

Static UPDATED_ENTERED

UPDATED_ENTERED: number = 8

This value indicates that update events should be evaluated, but only if filter evaluation is false for the old value and true for the new value. This corresponds to an item that was not in a keySet filter result changing such that it would now be in that keySet filter result.

Static UPDATED_LEFT

UPDATED_LEFT: number = 16

This value indicates that update events should be evaluated, but only if filter evaluation is true for the old value and false for the new value. This corresponds to an item that was in a keySet filter result changing such that it would no longer be in that keySet filter result.

Static UPDATED_WITHIN

UPDATED_WITHIN: number = 32

This value indicates that update events should be evaluated, but only if filter evaluation is true for both the old and the new value. This corresponds to an item that was in a keySet filter result changing but not leaving the keySet filter result.

Methods

and

  • Return a composed filter that represents a short-circuiting logical AND of this filter and another. When evaluating the composed filter, if this filter is `false, then the other filter is not evaluated.

    Any exceptions thrown during evaluation of either filter are relayed to the caller; if evaluation of this filter throws an exception, the *other* filter will not be evaluated.

    Parameters

    • other: Filter

      a filter that will be logically-ANDed with this filter

    Returns Filter

    a composed filter that represents the short-circuiting logical AND of this filter and the other filter

associatedWith

  • Return a key associated filter based on this filter and a specified key.

    Type parameters

    • K = any

    Parameters

    • key: K

      associated key

    Returns KeyAssociatedFilter

    a key associated filter

forKeys

  • Return a filter that will only be evaluated within specified key set.

    Type parameters

    • K = any

    Parameters

    • keys: Set<K>

      the set of keys to limit the filter evaluation to

    Returns InKeySetFilter<K>

    a key set-limited filter

or

  • Return a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate is true, then the other predicate is not evaluated.

    Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the *other* predicate will not be evaluated.

    Parameters

    • other: Filter

      a predicate that will be logically-ORed with this predicate

    Returns Filter

    a composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate

xor

  • Return a composed predicate that represents a logical XOR of this predicate and another.

    Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the other predicate will not be evaluated.

    Parameters

    • other: Filter

      a predicate that will be logically-XORed with this predicate

    Returns Filter

    a composed predicate that represents the logical XOR of this predicate and the 'other' predicate