Package com.apama.jmon
Class PreparedEventExpression
- java.lang.Object
- 
- com.apama.jmon.EventExpression
- 
- com.apama.jmon.PreparedEventExpression
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class PreparedEventExpression extends EventExpression implements java.io.Serializable Instances of this class are created from PreparedEventExpressionTemplateobjects. The parameter fields of the PreparedEventExpression can then be filled in to create a fully-qualified event expression, to whichMatchListenerobjects can be attached.For example, the statement: 
 PreparedEventExpressionTemplate et = new PreparedEventExpressionTemplate("on NewsItem(?, *):news -> StockTick(?, *)");creates a template with two parameters, indicated by the '?' characters in the template string. The template may then be instantiated:PreparedEventExpression pex = et.getInstance(); pex.setString(0, "ACME"); pex.setString(1, "ACME"); ThePreparedEventExpressionobject may then haveMatchListenerobjects attached to it as usual. In this example the matching NewsItem event is co-assigned to the variable called news. This means that the NewsItem event that caused the match will be available to theMatchListenerfrom the firedMatchEventby calling evt.getMatchingEvent("news");When the expression is matched, all registered listeners will be informed. An object implementing the MatchListenerinterface may be registered by calling theaddMatchListenermethod, and deregistered by calling theremoveMatchListenermethod.- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMatchListener(MatchListener listenerToAdd)Add a listener to be notified when the match occurs for this event expression.voidremoveAllMatchListeners()Remove all previously registered match listeners.voidsetBoolean(int position, boolean value)Set a Boolean type parameter in the PreparedEventExpression.voidsetDouble(int position, double value)Set a double type parameter in the PreparedEventExpression.voidsetLocation(int position, Location value)Set a Location type parameter in the PreparedEventExpression.voidsetLong(int position, long value)Set a long type parameter in the PreparedEventExpression.voidsetString(int position, java.lang.String value)Set a string type parameter in the PreparedEventExpression.java.lang.StringtoString()Get the String value of the PreparedEventExpression,- 
Methods inherited from class com.apama.jmon.EventExpressiongetEventExpressionString, removeMatchListener
 
- 
 
- 
- 
- 
Method Detail- 
toStringpublic java.lang.String toString() Get the String value of the PreparedEventExpression,- Overrides:
- toStringin class- EventExpression
- Returns:
- A nice String.
- See Also:
- EventExpression.getEventExpressionString()
 
 - 
setDoublepublic void setDouble(int position, double value) throws PreparedEventExpressionExceptionSet a double type parameter in the PreparedEventExpression.- Parameters:
- position- Parameter position with the expression template, counting from zero.
- value- The double value of the parameter.
- Throws:
- PreparedEventExpressionException
 
 - 
setLongpublic void setLong(int position, long value) throws PreparedEventExpressionExceptionSet a long type parameter in the PreparedEventExpression.- Parameters:
- position- Parameter position with the expression template, counting from zero.
- value- The long value of the parameter.
- Throws:
- PreparedEventExpressionException
 
 - 
setStringpublic void setString(int position, java.lang.String value) throws PreparedEventExpressionExceptionSet a string type parameter in the PreparedEventExpression.- Parameters:
- position- Parameter position with the expression template, counting from zero.
- value- The string value of the parameter.
- Throws:
- PreparedEventExpressionException
 
 - 
setBooleanpublic void setBoolean(int position, boolean value) throws PreparedEventExpressionExceptionSet a Boolean type parameter in the PreparedEventExpression.- Parameters:
- position- Parameter position with the expression template, counting from zero.
- value- The Boolean value of the parameter.
- Throws:
- PreparedEventExpressionException
 
 - 
setLocationpublic void setLocation(int position, Location value) throws PreparedEventExpressionExceptionSet a Location type parameter in the PreparedEventExpression.- Parameters:
- position- Parameter position with the expression template, counting from zero.
- value- The Location value of the parameter.
- Throws:
- PreparedEventExpressionException
 
 - 
addMatchListenerpublic void addMatchListener(MatchListener listenerToAdd) Add a listener to be notified when the match occurs for this event expression.- Overrides:
- addMatchListenerin class- EventExpression
- Parameters:
- listenerToAdd- an object implementing the MatchListener interface to be notified when matches occur for this expression.
 
 - 
removeAllMatchListenerspublic void removeAllMatchListeners() Remove all previously registered match listeners.- Overrides:
- removeAllMatchListenersin class- EventExpression
 
 
- 
 
-