org.openbandy.event
Interface EventFilter


public interface EventFilter

The EventFilter interface defines the methods a class must implement in order to absorb events of a given type and thus act as a filter. As a filter absorbs, i.e., filters, events before an EventSink, it's interface is similar to the latter one.

(c) Copyright Philipp Bolliger 2007, ALL RIGHTS RESERVED.

Version:
1.0
Author:
Philipp Bolliger (philipp@bolliger.name)
See Also:
EventSink

Method Summary
 void filter(Event event)
          Absorb the event, filter it and eventually forward the event to the corresponding EventSink.
 boolean filtersEventType(java.lang.String eventType)
          Indicate whether this filter absorbs and hence filters a provided type of event.
 EventSink getEventSinkUnfiltered()
          May return another instance of the event sink or null.
 void setEventSink(EventSink eventSink)
          Set the event sink that is target to this filter.
 

Method Detail

setEventSink

void setEventSink(EventSink eventSink)
Set the event sink that is target to this filter.

Parameters:
eventSink - The event sink

getEventSinkUnfiltered

EventSink getEventSinkUnfiltered()
May return another instance of the event sink or null. If this method returns a valid event sink object, the respective event sink will receive all events unfiltered.

Returns:
Reference to the EventSink that shall absorb the events unfiltered.

filtersEventType

boolean filtersEventType(java.lang.String eventType)
Indicate whether this filter absorbs and hence filters a provided type of event.

Parameters:
eventType - The short class name of the event type
Returns:
True if this filter absorbs this type of event

filter

void filter(Event event)
Absorb the event, filter it and eventually forward the event to the corresponding EventSink.

Parameters:
event - The event to filter