Class MatchUpdateAdapter<Match extends IPatternMatch>

  • All Implemented Interfaces:
    IMatchUpdateListener<Match>

    public class MatchUpdateAdapter<Match extends IPatternMatch>
    extends java.lang.Object
    implements IMatchUpdateListener<Match>
    A default implementation of IMatchUpdateListener that contains two match processors, one for appearance, one for disappearance. Any of the two can be null; in this case, corresponding notifications will be ignored.

    Instantiate using either constructor.

    • Constructor Detail

      • MatchUpdateAdapter

        public MatchUpdateAdapter​(java.util.function.Consumer<Match> appearCallback,
                                  java.util.function.Consumer<Match> disappearCallback)
        Constructs an instance by specifying match processors.
        Parameters:
        appearCallback - a match processor that will be invoked on each new match that appears. If null, no callback will be executed on match appearance. See Consumer for details on how to implement.
        disappearCallback - a match processor that will be invoked on each existing match that disappears. If null, no callback will be executed on match disappearance. See Consumer for details on how to implement.
        Since:
        2.0
    • Method Detail

      • getAppearCallback

        public java.util.function.Consumer<Match> getAppearCallback()
        Returns:
        the match processor that will be invoked on each new match that appears. If null, no callback will be executed on match appearance.
        Since:
        2.0
      • setAppearCallback

        public void setAppearCallback​(java.util.function.Consumer<Match> appearCallback)
        Parameters:
        appearCallback - a match processor that will be invoked on each new match that appears. If null, no callback will be executed on match appearance. See Consumer for details on how to implement.
        Since:
        2.0
      • getDisappearCallback

        public java.util.function.Consumer<Match> getDisappearCallback()
        Returns:
        the match processor that will be invoked on each existing match that disappears. If null, no callback will be executed on match disappearance.
        Since:
        2.0
      • setDisappearCallback

        public void setDisappearCallback​(java.util.function.Consumer<Match> disappearCallback)
        Parameters:
        disappearCallback - a match processor that will be invoked on each existing match that disappears. If null, no callback will be executed on match disappearance. See Consumer for details on how to implement.
        Since:
        2.0