com.espertech.esper.client.soda
Class OutputLimitClause

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

public class OutputLimitClause
extends java.lang.Object
implements java.io.Serializable

An output limit clause defines how to limit output of statements and consists of a selector specifiying which events to select to output, a frequency and a unit.

See Also:
Serialized Form

Constructor Summary
OutputLimitClause()
          Ctor.
OutputLimitClause(OutputLimitSelector selector, java.lang.Double frequency)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, java.lang.Double frequency, java.lang.String frequencyVariable, OutputLimitUnit unit)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, Expression[] crontabAtParameters)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, Expression whenExpression, java.util.List<Assignment> thenAssignments)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, OutputLimitUnit unit)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, OutputLimitUnit unit, TimePeriodExpression afterTimePeriod, java.lang.Integer afterNumberOfEvents)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, java.lang.String frequencyVariable)
          Ctor.
OutputLimitClause(OutputLimitSelector selector, TimePeriodExpression timePeriodExpression)
          Ctor.
OutputLimitClause(TimePeriodExpression afterTimePeriodExpression)
          Ctor.
 
Method Summary
 OutputLimitClause addThenAssignment(Expression assignmentExpression)
          Adds a then-keyword variable assigment for use with the when-keyword.
 OutputLimitClause afterNumberOfEvents(java.lang.Integer afterNumberOfEvents)
          Sets the after-keyword number of events, or null if undefined.
 OutputLimitClause afterTimePeriodExpression(TimePeriodExpression afterTimePeriodExpression)
          Sets the after-keyword time period.
static OutputLimitClause create(double frequency)
          Creates an output limit clause.
static OutputLimitClause create(Expression whenExpression)
          Creates an output limit clause with a when-expression and optional then-assignment expressions to be added.
static OutputLimitClause create(OutputLimitSelector selector, double frequency)
          Creates an output limit clause.
static OutputLimitClause create(OutputLimitSelector selector, java.lang.String frequencyVariable)
          Creates an output limit clause.
static OutputLimitClause create(OutputLimitSelector selector, TimePeriodExpression timePeriodExpression)
          Creates an output limit clause.
static OutputLimitClause create(java.lang.String frequencyVariable)
          Creates an output limit clause.
static OutputLimitClause create(TimePeriodExpression timePeriodExpression)
          Creates an output limit clause.
static OutputLimitClause createAfter(int afterNumEvents)
          Create with after-only and number of events.
static OutputLimitClause createAfter(TimePeriodExpression afterTimePeriodExpression)
          Create with after-only time period.
static OutputLimitClause createSchedule(Expression[] scheduleParameters)
          Creates an output limit clause with a crontab 'at' schedule parameters, see FrequencyParameter and related.
 java.lang.Integer getAfterNumberOfEvents()
          Returns the after-keyword number of events, or null if undefined.
 Expression getAfterTimePeriodExpression()
          Returns the after-keyword time period.
 Expression getAndAfterTerminateAndExpr()
          Returns the optional expression evaluated when a context partition terminates before triggering output.
 java.util.List<Assignment> getAndAfterTerminateThenAssignments()
          Returns the set-assignments to execute when a context partition terminates.
 Expression[] getCrontabAtParameters()
          Returns the crontab parameters, or null if not using crontab-like schedule.
 java.lang.Double getFrequency()
          Returns output frequency.
 java.lang.String getFrequencyVariable()
          Returns the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.
 OutputLimitSelector getSelector()
          Returns the selector indicating the events to output.
 java.util.List<Assignment> getThenAssignments()
          Returns the list of optional then-keyword variable assignments, if any
 Expression getTimePeriodExpression()
          Returns the time period, or null if none provided.
 OutputLimitUnit getUnit()
          Returns the unit the frequency is in.
 Expression getWhenExpression()
          Returns the expression that controls output for use with the when-keyword.
 boolean isAndAfterTerminate()
          Returns true for output upon termination of a context partition
 void setAfterNumberOfEvents(java.lang.Integer afterNumberOfEvents)
          Sets the after-keyword number of events, or null if undefined.
 void setAfterTimePeriodExpression(Expression afterTimePeriodExpression)
          Sets the after-keyword time period.
 void setAndAfterTerminate(boolean andAfterTerminate)
          Set true for output upon termination of a context partition
 void setAndAfterTerminateAndExpr(Expression andAfterTerminateAndExpr)
          Sets an optional expression evaluated when a context partition terminates before triggering output.
 void setAndAfterTerminateThenAssignments(java.util.List<Assignment> andAfterTerminateThenAssignments)
          Sets the set-assignments to execute when a context partition terminates.
 void setCrontabAtParameters(Expression[] crontabAtParameters)
          Crontab.
 void setFrequency(double frequency)
          Sets output frequency.
 void setFrequency(java.lang.Double frequency)
          Set frequency.
 void setFrequencyVariable(java.lang.String frequencyVariable)
          Sets the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.
 void setSelector(OutputLimitSelector selector)
          Sets the selector indicating the events to output.
 void setThenAssignments(java.util.List<Assignment> thenAssignments)
          Set then.
 void setTimePeriodExpression(Expression timePeriodExpression)
          Crontab
 void setUnit(OutputLimitUnit unit)
          Sets the unit the frequency is in.
 void setWhenExpression(Expression whenExpression)
          Set when.
 void toEPL(java.io.StringWriter writer)
          Renders the clause in textual representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputLimitClause

public OutputLimitClause()
Ctor.


OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         OutputLimitUnit unit)
Ctor.

Parameters:
selector - selector
unit - unit

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         java.lang.Double frequency)
Ctor.

Parameters:
selector - is the events to select
frequency - a frequency to output at

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         TimePeriodExpression timePeriodExpression)
Ctor.

Parameters:
selector - is the events to select
timePeriodExpression - the unit for the frequency

OutputLimitClause

public OutputLimitClause(TimePeriodExpression afterTimePeriodExpression)
Ctor.

Parameters:
afterTimePeriodExpression - timer period for after.

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         java.lang.String frequencyVariable)
Ctor.

Parameters:
selector - is the events to select
frequencyVariable - is the variable name providing output rate frequency values

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         java.lang.Double frequency,
                         java.lang.String frequencyVariable,
                         OutputLimitUnit unit)
Ctor.

Parameters:
selector - is the events to select
frequency - a frequency to output at
unit - the unit for the frequency
frequencyVariable - is the variable name providing output rate frequency values

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         OutputLimitUnit unit,
                         TimePeriodExpression afterTimePeriod,
                         java.lang.Integer afterNumberOfEvents)
Ctor.

Parameters:
selector - is the events to select
unit - the unit of selection
afterTimePeriod - after-keyword time period
afterNumberOfEvents - after-keyword number of events

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         Expression[] crontabAtParameters)
Ctor.

Parameters:
selector - is the events to select
crontabAtParameters - the crontab schedule parameters

OutputLimitClause

public OutputLimitClause(OutputLimitSelector selector,
                         Expression whenExpression,
                         java.util.List<Assignment> thenAssignments)
Ctor.

Parameters:
selector - is the events to select
whenExpression - the boolean expression to evaluate to control output
thenAssignments - the variable assignments, optional or an empty list
Method Detail

create

public static OutputLimitClause create(TimePeriodExpression timePeriodExpression)
Creates an output limit clause.

Parameters:
timePeriodExpression - a frequency to output at
Returns:
clause

createAfter

public static OutputLimitClause createAfter(TimePeriodExpression afterTimePeriodExpression)
Create with after-only time period.

Parameters:
afterTimePeriodExpression - time period
Returns:
clause

createAfter

public static OutputLimitClause createAfter(int afterNumEvents)
Create with after-only and number of events.

Parameters:
afterNumEvents - num events
Returns:
clause

create

public static OutputLimitClause create(OutputLimitSelector selector,
                                       TimePeriodExpression timePeriodExpression)
Creates an output limit clause.

Parameters:
selector - is the events to select
timePeriodExpression - a frequency to output at
Returns:
clause

create

public static OutputLimitClause create(OutputLimitSelector selector,
                                       double frequency)
Creates an output limit clause.

Parameters:
selector - is the events to select
frequency - a frequency to output at
Returns:
clause

create

public static OutputLimitClause create(OutputLimitSelector selector,
                                       java.lang.String frequencyVariable)
Creates an output limit clause.

Parameters:
selector - is the events to select
frequencyVariable - is the variable providing the output limit frequency
Returns:
clause

create

public static OutputLimitClause create(double frequency)
Creates an output limit clause.

Parameters:
frequency - a frequency to output at
Returns:
clause

create

public static OutputLimitClause create(java.lang.String frequencyVariable)
Creates an output limit clause.

Parameters:
frequencyVariable - is the variable name providing output rate frequency values
Returns:
clause

create

public static OutputLimitClause create(Expression whenExpression)
Creates an output limit clause with a when-expression and optional then-assignment expressions to be added.

Parameters:
whenExpression - the expression that returns true to trigger output
Returns:
clause

createSchedule

public static OutputLimitClause createSchedule(Expression[] scheduleParameters)
Creates an output limit clause with a crontab 'at' schedule parameters, see FrequencyParameter and related.

Parameters:
scheduleParameters - the crontab schedule parameters
Returns:
clause

getSelector

public OutputLimitSelector getSelector()
Returns the selector indicating the events to output.

Returns:
selector

setSelector

public void setSelector(OutputLimitSelector selector)
Sets the selector indicating the events to output.

Parameters:
selector - to set

getFrequency

public java.lang.Double getFrequency()
Returns output frequency.

Returns:
frequency of output

setFrequency

public void setFrequency(double frequency)
Sets output frequency.

Parameters:
frequency - is the frequency of output

getUnit

public OutputLimitUnit getUnit()
Returns the unit the frequency is in.

Returns:
unit for the frequency.

setUnit

public void setUnit(OutputLimitUnit unit)
Sets the unit the frequency is in.

Parameters:
unit - is the unit for the frequency

getFrequencyVariable

public java.lang.String getFrequencyVariable()
Returns the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.

Returns:
variable name or null if no variable is used

setFrequencyVariable

public void setFrequencyVariable(java.lang.String frequencyVariable)
Sets the variable name of the variable providing output rate frequency values, or null if the frequency is a fixed value.

Parameters:
frequencyVariable - variable name or null if no variable is used

getWhenExpression

public Expression getWhenExpression()
Returns the expression that controls output for use with the when-keyword.

Returns:
expression should be boolean result

getTimePeriodExpression

public Expression getTimePeriodExpression()
Returns the time period, or null if none provided.

Returns:
time period

getThenAssignments

public java.util.List<Assignment> getThenAssignments()
Returns the list of optional then-keyword variable assignments, if any

Returns:
list of variable assignments or null if none

addThenAssignment

public OutputLimitClause addThenAssignment(Expression assignmentExpression)
Adds a then-keyword variable assigment for use with the when-keyword.

Parameters:
assignmentExpression - expression to calculate new value
Returns:
clause

getCrontabAtParameters

public Expression[] getCrontabAtParameters()
Returns the crontab parameters, or null if not using crontab-like schedule.

Returns:
parameters

isAndAfterTerminate

public boolean isAndAfterTerminate()
Returns true for output upon termination of a context partition

Returns:
indicator

setAndAfterTerminate

public void setAndAfterTerminate(boolean andAfterTerminate)
Set true for output upon termination of a context partition

Parameters:
andAfterTerminate - indicator

toEPL

public void toEPL(java.io.StringWriter writer)
Renders the clause in textual representation.

Parameters:
writer - to output to

getAfterTimePeriodExpression

public Expression getAfterTimePeriodExpression()
Returns the after-keyword time period.

Returns:
after-keyword time period

setAfterTimePeriodExpression

public void setAfterTimePeriodExpression(Expression afterTimePeriodExpression)
Sets the after-keyword time period.

Parameters:
afterTimePeriodExpression - after-keyword time period

afterTimePeriodExpression

public OutputLimitClause afterTimePeriodExpression(TimePeriodExpression afterTimePeriodExpression)
Sets the after-keyword time period.

Parameters:
afterTimePeriodExpression - after-keyword time period
Returns:
clause

getAfterNumberOfEvents

public java.lang.Integer getAfterNumberOfEvents()
Returns the after-keyword number of events, or null if undefined.

Returns:
num events for after-keyword

setFrequency

public void setFrequency(java.lang.Double frequency)
Set frequency.

Parameters:
frequency - to set

setWhenExpression

public void setWhenExpression(Expression whenExpression)
Set when.

Parameters:
whenExpression - to set

setThenAssignments

public void setThenAssignments(java.util.List<Assignment> thenAssignments)
Set then.

Parameters:
thenAssignments - to set

setCrontabAtParameters

public void setCrontabAtParameters(Expression[] crontabAtParameters)
Crontab.

Parameters:
crontabAtParameters - to set

setTimePeriodExpression

public void setTimePeriodExpression(Expression timePeriodExpression)
Crontab

Parameters:
timePeriodExpression - to set

setAfterNumberOfEvents

public void setAfterNumberOfEvents(java.lang.Integer afterNumberOfEvents)
Sets the after-keyword number of events, or null if undefined.

Parameters:
afterNumberOfEvents - set num events for after-keyword

afterNumberOfEvents

public OutputLimitClause afterNumberOfEvents(java.lang.Integer afterNumberOfEvents)
Sets the after-keyword number of events, or null if undefined.

Parameters:
afterNumberOfEvents - set num events for after-keyword
Returns:
clause

getAndAfterTerminateAndExpr

public Expression getAndAfterTerminateAndExpr()
Returns the optional expression evaluated when a context partition terminates before triggering output.

Returns:
expression

setAndAfterTerminateAndExpr

public void setAndAfterTerminateAndExpr(Expression andAfterTerminateAndExpr)
Sets an optional expression evaluated when a context partition terminates before triggering output.

Parameters:
andAfterTerminateAndExpr - expression

getAndAfterTerminateThenAssignments

public java.util.List<Assignment> getAndAfterTerminateThenAssignments()
Returns the set-assignments to execute when a context partition terminates.

Returns:
set-assignments

setAndAfterTerminateThenAssignments

public void setAndAfterTerminateThenAssignments(java.util.List<Assignment> andAfterTerminateThenAssignments)
Sets the set-assignments to execute when a context partition terminates.

Parameters:
andAfterTerminateThenAssignments - set-assignments

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com