Class CacheEventFilter<K,​V>

    • Field Detail

      • E_SYNTHETIC

        public static final int E_SYNTHETIC
        Bitmask to select synthetic events.
        See Also:
        Constant Field Values
      • E_NATURAL

        public static final int E_NATURAL
        Bitmask to select natural events.
        See Also:
        Constant Field Values
      • m_nMaskSynthetic

        protected int m_nMaskSynthetic
        Bitmask that selects whether to include synthetic, natural, or all events.
    • Constructor Detail

      • CacheEventFilter

        public CacheEventFilter()
        Default constructor (necessary for the ExternalizableLite interface).
      • CacheEventFilter

        public CacheEventFilter​(int nMask,
                                int nMaskSynthetic)
        Construct a CacheEventFilter that evaluates MapEvent objects based on the specified combination of event types.

        Using this constructor is equivalent to: new CacheEventFilter(nMask, null, nMaskSynthetic);

        Parameters:
        nMask - any combination of E_INSERTED, E_UPDATED and E_DELETED, E_UPDATED_ENTERED, E_UPDATED_WITHIN, E_UPDATED_LEFT
        nMaskSynthetic - any combination of E_SYNTHETIC and E_NATURAL
      • CacheEventFilter

        public CacheEventFilter​(Filter<V> filter,
                                int nMaskSynthetic)
        Construct a CacheEventFilter that evaluates MapEvent objects that would affect the results of a keySet filter issued by a previous call to QueryMap.keySet(com.tangosol.util.Filter). It is possible to easily implement continuous query functionality.

        Using this constructor is equivalent to: new CacheEventFilter(E_KEYSET, filter, nMaskSynthetic);

        Parameters:
        filter - the filter passed previously to a keySet() query method
        nMaskSynthetic - any combination of E_SYNTHETIC and E_NATURAL
      • CacheEventFilter

        public CacheEventFilter​(int nMask,
                                Filter<V> filter,
                                int nMaskSynthetic)
        Construct a CacheEventFilter that evaluates MapEvent objects based on the specified combination of event types.
        Parameters:
        nMask - combination of any of the E_* values
        filter - (optional) the filter used for evaluating event values
        nMaskSynthetic - any combination of E_SYNTHETIC and E_NATURAL
    • Method Detail

      • evaluate

        public boolean evaluate​(MapEvent<K,​V> o)
        Apply the test to the input argument.
        Specified by:
        evaluate in interface Filter<K>
        Overrides:
        evaluate in class MapEventFilter<K,​V>
        Parameters:
        o - the input argument to evaluate
        Returns:
        true if the input argument matches the filter, otherwise false
      • equals

        public boolean equals​(Object o)
        Compare the CacheEventFilter with another object to determine equality.
        Overrides:
        equals in class MapEventFilter<K,​V>
        Returns:
        true iff this CacheEventFilter and the passed object are equivalent filters
      • hashCode

        public int hashCode()
        Determine a hash value for the CacheEventFilter object according to the general Object.hashCode() contract.
        Overrides:
        hashCode in class MapEventFilter<K,​V>
        Returns:
        an integer hash value for this MapEventFilter object
      • readExternal

        public void readExternal​(DataInput in)
                          throws IOException
        Restore the contents of this object by loading the object's state from the passed DataInput object.
        Specified by:
        readExternal in interface ExternalizableLite
        Overrides:
        readExternal in class MapEventFilter<K,​V>
        Parameters:
        in - the DataInput stream to read data from in order to restore the state of this object
        Throws:
        IOException - if an I/O exception occurs
        NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into