com.espertech.esper.client.soda
Class Filter

java.lang.Object
  extended by com.espertech.esper.client.soda.Filter
All Implemented Interfaces:
Serializable

public class Filter
extends Object
implements Serializable

Filter defines the event type to be filtered for, and an optional expression that returns true if the filter should consider the event, or false to reject the event.

See Also:
Serialized Form

Constructor Summary
Filter(String eventTypeAlias)
          Ctor.
Filter(String eventTypeAlias, Expression filter)
          Ctor.
 
Method Summary
static Filter create(String eventTypeAlias)
          Creates a filter to the given named event type.
static Filter create(String eventTypeAlias, Expression filter)
          Creates a filter to the given named event type and filter expression.
 String getEventTypeAlias()
          Returns the name of the event type to filter for.
 Expression getFilter()
          Returns the optional filter expression that tests the event, or null if no filter expression was defined.
 void setEventTypeAlias(String eventTypeAlias)
          Sets the name of the event type to filter for.
 void setFilter(Expression filter)
          Sets the optional filter expression that tests the event, or null if no filter expression is needed.
 void toEPL(StringWriter writer)
          Returns a textual representation of the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter(String eventTypeAlias)
Ctor.

Parameters:
eventTypeAlias - is the event type name

Filter

public Filter(String eventTypeAlias,
              Expression filter)
Ctor.

Parameters:
eventTypeAlias - is the event type name
filter - is the filter expression
Method Detail

create

public static Filter create(String eventTypeAlias)
Creates a filter to the given named event type.

Parameters:
eventTypeAlias - is the event type name to filter for
Returns:
filter

create

public static Filter create(String eventTypeAlias,
                            Expression filter)
Creates a filter to the given named event type and filter expression.

Parameters:
eventTypeAlias - is the event type name to filter for
filter - is the expression filtering out events
Returns:
filter is the filter expression

getEventTypeAlias

public String getEventTypeAlias()
Returns the name of the event type to filter for.

Returns:
event type alias name

setEventTypeAlias

public void setEventTypeAlias(String eventTypeAlias)
Sets the name of the event type to filter for.

Parameters:
eventTypeAlias - name or alias of the event type to filter for

getFilter

public Expression getFilter()
Returns the optional filter expression that tests the event, or null if no filter expression was defined.

Returns:
filter expression

setFilter

public void setFilter(Expression filter)
Sets the optional filter expression that tests the event, or null if no filter expression is needed.

Parameters:
filter - is the filter expression to set

toEPL

public void toEPL(StringWriter writer)
Returns a textual representation of the filter.

Parameters:
writer - to output to

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com