public class MatchUpdateAdapter<Match extends IPatternMatch> extends java.lang.Object implements IMatchUpdateListener<Match>
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 and Description |
---|
MatchUpdateAdapter()
Constructs an instance without any match processors registered yet.
|
MatchUpdateAdapter(IMatchProcessor<Match> appearCallback,
IMatchProcessor<Match> disappearCallback)
Constructs an instance by specifying match processors.
|
Modifier and Type | Method and Description |
---|---|
IMatchProcessor<Match> |
getAppearCallback() |
IMatchProcessor<Match> |
getDisappearCallback() |
void |
notifyAppearance(Match match)
Will be invoked on each new match that appears.
|
void |
notifyDisappearance(Match match)
Will be invoked on each existing match that disappears.
|
void |
setAppearCallback(IMatchProcessor<Match> appearCallback) |
void |
setDisappearCallback(IMatchProcessor<Match> disappearCallback) |
public MatchUpdateAdapter()
setAppearCallback(IMatchProcessor)
and setDisappearCallback(IMatchProcessor)
to specify
optional match processors for match appearance and disappearance, respectively.public MatchUpdateAdapter(IMatchProcessor<Match> appearCallback, IMatchProcessor<Match> disappearCallback)
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 IMatchProcessor
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 IMatchProcessor
for details on how to implement.public IMatchProcessor<Match> getAppearCallback()
public void setAppearCallback(IMatchProcessor<Match> appearCallback)
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 IMatchProcessor
for details on how to implement.public IMatchProcessor<Match> getDisappearCallback()
public void setDisappearCallback(IMatchProcessor<Match> disappearCallback)
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 IMatchProcessor
for details on how to implement.public void notifyAppearance(Match match)
IMatchUpdateListener
notifyAppearance
in interface IMatchUpdateListener<Match extends IPatternMatch>
match
- the match that has just appeared.public void notifyDisappearance(Match match)
IMatchUpdateListener
notifyDisappearance
in interface IMatchUpdateListener<Match extends IPatternMatch>
match
- the match that has just disappeared.