|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.eventhorizongilde.ehfs.milestone.AbstractMilestone
de.eventhorizongilde.ehfs.milestone.AbstractFilterMilestone
public abstract class AbstractFilterMilestone
Convenience milestone implementation that informs of events that match one or more filters.
To use this class, one or more filters must be added. This should be done during initialization. Filters may be added (and removed, if necessary) through different sets of methods:
addFilter(IEventFilter, IEventHandler) and
removeFilter(IEventFilter), oraddFilter(String, IEventFilter) and
removeFilter(String)The first set of methods requires the implementation of event handlers,
while the second set requires overriding of eventHappened(String, CombatEvent)
to be informed of events.
| Constructor Summary | |
|---|---|
protected |
AbstractFilterMilestone()
Creates a new filter milestone with no filters. |
| Method Summary | |
|---|---|
protected void |
addFilter(IEventFilter filter,
IEventHandler handler)
Adds an event filter associated with an event handler. |
protected void |
addFilter(String key,
IEventFilter filter)
Adds an event filter. |
void |
eventHappened(CombatEvent event)
Informs the milestone that an event happened during the fight. Subclasses should override eventHappened(String, CombatEvent)
instead of this method. |
protected void |
eventHappened(String key,
CombatEvent event)
Informs the milestone that an event happened during the fight. |
protected void |
removeFilter(IEventFilter filter)
Removes an event filter and its associated event handler. |
protected void |
removeFilter(String key)
Removes the event filter associated with the specified key. |
| Methods inherited from class de.eventhorizongilde.ehfs.milestone.AbstractMilestone |
|---|
addAnnotation, deactivate, fightEnded, getAnnotationGroup, getParseContext, setColorKeyId, setParseContext, toSeconds, toSeconds |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractFilterMilestone()
| Method Detail |
|---|
public void eventHappened(CombatEvent event)
Subclasses should override eventHappened(String, CombatEvent)
instead of this method.
protected void eventHappened(String key,
CombatEvent event)
key - the key that a filter has been associated withevent - the fight eventaddFilter(String, IEventFilter)
protected void addFilter(String key,
IEventFilter filter)
eventHappened(String, CombatEvent) is invoked with
the key and the event.
key - the key to associate the filter withfilter - the filter that events must match before informing of themeventHappened(String, CombatEvent),
removeFilter(String)protected void removeFilter(String key)
addFilter(String, IEventFilter)
protected void addFilter(IEventFilter filter,
IEventHandler handler)
eventHappened() method is invoked
with the event.
filter - the filter that events must match before the handler is
informed of themhandler - the handler that is informed of matching eventsremoveFilter(IEventFilter)protected void removeFilter(IEventFilter filter)
addFilter(IEventFilter, IEventHandler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||