Apama 10.1 | Apama Documentation | Developing Apama Applications | EPL Methods Quick Reference
 
EPL Methods Quick Reference
This reference lists all EPL methods. It is meant as a concise reminder of the method signatures for convenient printing and viewing. For more detailed information on these methods, see Types, which is part of the EPL Reference.
action methods
The only operation that you can perform on an action variable is to call it. You do this in the normal way by passing a set of parameters in parentheses after an expression that evaluates to the action variable. For an example and additional details, see Using action type variables.
For more information on the action type, see action.
any methods
The methods available to the any type are:
Method
Result
clone() returns any
Returns a new any that is an exact copy of the any that this method is called on.
getAction(string name) returns any
Gets the action or method by name.
getActionNames() returns sequence<string>
Gets the names of the actions or methods within this any.
getActionParameterNames() returns sequence<string>
Gets the parameter names of the action contained in this any.
getActionParameters() returns dictionary<string,string>
Gets a dictionary whose keys are the parameter names of the action contained in this any, and whose values are the types of each parameter.
getActionReturnTypeName() returns string
Gets the name of the return type of the action contained in this any.
getConstant(string) returns any
Gets the value of a constant by name.
getConstantNames() returns sequence<string>
Gets the names of the constants within this any.
getEntries() returns sequence<any>
Gets a sequence of all of the entries (empty if getKeys() returns empty).
getEntry(any key) returns any
Gets the entry.
getGenericAction() returns action<sequence<any> > returns any
Gets the "generic" form of the action.
getKeys() returns sequence<any>
Returns the names of the fields of the value's types for structured values, that is, events, boxed primitive objects (which have a single "value" field), dictionaries and sequences.
getTypeName() returns string
Returns the fully-qualified name of the value's type (or the word "empty").
getTypes() returns sequence<string>
Similar to getKeys(), but returns the full type names of the keys.
setEntry(any key, any value)
Sets the named entry.
static canParse(string s) returns boolean
Returns true if the parsing of the string succeeds.
static newInstance(string typeName) returns any
Creates a new (default) instance if typeName names a type.
static parse(string s) returns any
Returns the any object represented by the string argument.
static parseType(string typeName, string stringForm) returns any
Creates a new instance if typeName names a type, and parses the stringForm into it.
toString() returns string
Creates a string representation of the any.
valueToString() returns string
Returns the result of calling .toString() on the contained value directly, or the word "empty" if there is no value.
When handling event fields (or dictionaries with a string key), the following methods may be used instead. These methods take and return strings for the field names, but are otherwise equivalent to getKeys, getTypes, getEntry, getEntries and setEntry above. These methods throw an exception if the any type does not contain an event or dictionary with a string key (unless stated otherwise).
*getFieldNames() returns seq<string> — Similar to getKeys(), but returns the string form of the keys.
*getFieldString(string fieldName) returns string — Returns a given field converted toString(), else throws an exception.
*getField(string fieldName) returns any — Returns a given field. Throws an exception if the field is not found.
*setField(string fieldName, any value) — Sets the named field. Throws an exception if the field is not found.
*getFieldTypes() returns sequence<string> — Synonym of getTypes().
*getFieldValues() returns sequence<string> — Returns the string form of all fields (empty if getKeys() returns empty). Will never throw an exception.
*getFields() returns sequence<any> — Synonym of getEntries().
For more information on the any type, see any.
boolean methods
The following methods may be called on variables of boolean type:
Method
Result
canParse(string)
Returns true if the string argument can be successfully parsed.
parse(string)
Returns the boolean instance represented by the string argument.
toString()
Returns a string representation of the Boolean.
For more information on the boolean type, see boolean.
Channel methods
The following methods may be called on values of Channel type:
Method
Result
canParse(string)
Returns true if the string argument can be successfully parsed to create a Channel object.
clone()
Returns a new channel that is an exact copy of the channel that this method is called on. The original content of the channel is copied into the new channel.
empty()
Returns true if the Channel object contains an empty context.
parse(string)
Returns the Channel instance represented by the string argument.
toString()
Returns a string that contains the channel name or the name of the contained context.
For more information on the Channel type, see Channel.
chunk methods
The following methods may be called on variables of chunk type.
Method
Result
clone()
Requests that the plug-in returns a new chunk that is an exact copy of the chunk that this method is called on.
empty()
Returns true if the chunk is empty.
getOwner()
Returns a string that contains the name of the EPL plug-in that the chunk belongs to.
For more information on the chunk type, see chunk.
context methods
The following methods may be called on variables of context type:
Method
Result
current()
Returns a context object that is a reference to the current context.
getId()
Returns an integer that is the ID of the context.
getName()
Returns a string that is the name of the context.
iqSize()
Returns an integer that is the current number of elements in the input queue for this context.
isPublic()
Returns a Boolean that indicates whether the context is public. If the context was created as a public context, then the return value is true.
toString()
Returns a string that contains the properties of the context.
In addition, the current() static method returns a reference to the current context.
For more information on the context type, see context.
decimal and float methods
The following inbuilt methods may be called on variables of decimal or float type. Unless noted otherwise, if you call a method on a decimal type, the return value is a decimal, and if you call the method on a float type, the return value is a float. In all method descriptions, x represents the value that the method is called on.
Method
Result
abs()
Returns |x|, the absolute value of x.
acos()
Returns the inverse cosine of x in radians.
acosh()
Returns the inverse hyperbolic cosine of x.
asin()
Returns the inverse sine of x in radians.
asinh()
Returns the inverse hyperbolic sine of x.
atan()
Returns the inverse tangent of x.
atan2(y)
Returns the two-parameter inverse tangent of x and y.
atanh()
Returns the inverse hyperbolic tangent of x.
bitEquals(decimal)
bitEquals(float)
Returns true if the value it is called on and the value passed as an argument to the method are the same. The value the method is called on and the argument to the method must both be decimal types or must both be float types.
canParse(string)
Returns true if the string argument can be successfully parsed.
cbrt()
Returns the cube root of x.
ceil()
Returns the smallest possible integer that is greater than or equal to the value the method is called on.
cos()
Returns the cosine of x.
cosh()
Returns the hyperbolic cosine of x.
erf()
Returns the error function of x.
exp()
Returns e to the power x or ex, where x is the value of the decimal or float and where e is approximately 2.71828183.
exponent()
When called on a float value, this method returns the integer that is the exponent where x = mantissa*2exponent assuming 0.5 <= |mantissa| < 1.0. When called on a decimal value, this method returns the exponent where x = mantissa*10exponent assuming 0.1 <= |mantissa| < 1.0.
floor()
Returns the largest possible integer that is less than or equal to the value the method is called on.
fmod(y)
Returns x mod y in exact arithmetic.
formatFixed(integer)
Returns a string representation of the value the method is called on where the value is rounded to the number of decimal places specified in the argument.
formatScientific(integer)
Returns a string representation of the value the method is called on where the value is truncated to the number of significant figures specified in the argument and formatted in Scientific Notation.
fractionalPart()
Returns the fractional component of x.
gammal()
Returns the logarithm of the gamma function.
ilogb()
Returns an integer that is the binary exponent of non-zero x.
integralPart()
Returns an integer that is the integral part of a floating point value. Similar to floor(), which rounds down, and ceil(), which rounds up. integralPart() rounds towards zero.
isFinite()
Returns true if and only if the value it is called on is not +Infinity, -Infinity, or NaN.
isInfinite()
Returns true if and only if the value it is called on is +Infinity or -Infinity.
isNaN()
Returns true if and only if the value it is called on is NaN.
ln()
Returns the natural log of the value the method is called on.
log10()
Returns the log to base 10 of the value the method is called on.
mantissa()
When called on a float value, this method returns a mantissa where x = mantissa*2exponent assuming that 0.5 <= |mantissa| < 1.0. When called on a decimal value, this method returns a mantissa where x = mantissa*10exponent assuming that 0.1 <= |mantissa| < 1.0.
max(decimal, decimal)
max(float, float)
Returns the value of the larger operand. You can call this method on the decimal or float type, or on an instance of a decimal or float type.
min(decimal, decimal)
min(float, float)
Returns the value of the smaller operand. You can call this method on the decimal or float type, or on an instance of a decimal or float type.
nextafter(y)
Returns the next distinct floating-point number after x that is representable in the underlying type in the direction toward y.
parse(string)
Returns the decimal or float instance represented by the string argument.
pow(decimal)
Returns x to the power y (where y is the argument) or xy.
pow(float)
rand()
Returns a random value from 0.0 up to (but not including) the value the method was invoked on.
round()
Rounds to the nearest integer. Uses banker's rounding, which means the round-to-even method, to break ties.
scalbn(integer)
When called on a float value, this method returns x*2n, where n is of integer type. When called on a decimal value, this method returns x*10n, where n is of integer type.
sin()
Returns the sine of x.
sinh()
Returns the hyperbolic sine of x.
sqrt()
Returns the positive square root of the value it is called on.
tan()
Returns the tangent of x.
tanh()
Returns the hyperbolic tangent of x.
toDecimal()
Returns a decimal representation of the float.
toFloat()
Returns a float representation of the decimal.
toString()
Returns a string representation of the float or decimal it is called on.
For more information on the decimal type, see decimal.
For more information on the float type, see float.
dictionary methods
The methods available on the dictionary data structure are:
Method
Result
add(key, item)
Adds an entry to the dictionary.
canParse(string)
This method is available only on dictionaries where the item type is parseable. Returns true if the string argument can be successfully parsed to create a dictionary object.
clear()
Sets the size of the dictionary to 0, deleting all entries.
clone()
Returns a new dictionary that is an exact copy of the dictionary that this method is called on.
getDefault(key, item)
Before Apama 5.0, the getOr() method was called getDefault(). You should not use the getDefault() method. It remains only for backwards compatibility. It is deprecated and will be removed in a future release. Use the getOr() method instead.
getOr(key, alternative)
Returns the item that corresponds to the specified key. If the specified key is not in the dictionary, the getOr() method returns alternative.
getOrDefault(key)
Retrieves an existing item by its key, or returns a default instance of the dictionary's item type if the dictionary does not contain the specified key.
getOrAdd(key, alternative)
Retrieves an existing item by its key, or adds the specified key to the dictionary with alternative as its value if it is not already present and also returns the specified alternative.
getOrAddDefault(key)
Retrieves an existing item by its key or, if it is not already present, adds the specified key with a default instance of the dictionary's item type and returns that instance.
hasKey(key)
Returns true if a key exists within the dictionary, false otherwise.
keys()
Returns a sequence of the dictionary's keys sorted in ascending order.
parse(string)
This method is available only on dictionaries where the item type is parseable. Returns the dictionary object represented by the string argument.
remove(key)
Removes an entry by key.
size()
Returns as an integer the number of elements in the dictionary.
toString()
Converts the entire dictionary in ascending order of key values to a string.
values()
Returns a sequence of the dictionary's items sorted in ascending order of keys.
[key]
Retrieves or overwrites an existing item by its key, or creates a new item.
For more information on the dictionary type, see dictionary.
event methods
The following methods may be called on variables of event type and on event types:
Method
Result
canParse(string)
This method is available only on events that are parseable. Returns true if the string argument can be successfully parsed to create an event object.
clone()
Returns a new event that is an exact copy of the event that this method is called on.
getFieldNames()
Returns a sequence of strings that contain the field names of an event type.
getFieldTypes()
Returns a sequence of strings that contain the type names of an event type's fields.
getFieldValues()
Returns a sequence of strings that contain the string versions of the event's field values.
getName()
Returns a string whose value is an event's type name.
getTime()
Returns a float that indicates a time expressed in seconds since the epoch, January 1st, 1970.
isExternal()
Returns a Boolean that indicates whether the event was generated by an external source.
parse(string)
This method is available only on events that are parseable. Returns the event object represented by the string argument.
toString()
Returns a string representation of the event.
For more information on the event type, see event.
Exception methods
The Exception type is defined in the com.apama.exceptions namespace.
The following methods may be called on values of Exception type:
Method
Result
getMessage()
Returns a string that contains the exception message.
getStackTrace()
Returns a sequence of StackTraceElement objects that represent the stack trace for when the exception was first thrown.
getType()
Returns a string that contains the exception type.
toString()
Returns a string that contains the exception message and the exception type.
toStringWithStackTrace()
Returns a string that contains the exception message, the exception type, and the stack trace elements.
For more information on the Exception type, see Exception.
integer methods
The following methods may be called on variables of integer type:
Method
Result
abs()
Returns as an integer the absolute value of i or |i|, where i is the value of the integer.
canParse(string)
Returns true if the string argument can be successfully parsed.
getUnique()
Generates a unique integer in the scope of the correlator. This is a type method as well as an instance method.
incrementCounter(string)
Generates a monotonically increasing integer for the corresponding string key passed as a function argument in the scope of the correlator. This is a type method as well as an instance method.
max(integer, integer)
Returns as an integer the value of the larger operand. You can call this method on the integer type or on an instance of an integer type.
min(integer, integer)
Returns as an integer the value of the smaller operand. You can call this method on the integer type or on an instance of an integer type.
parse(string)
Returns the integer instance represented by the string argument. You can call this method on the integer type or on an instance of an integer type.
pow(integer)
Returns as an integer the value of the operand to the power x (where x is the argument) or x, where i is the value of the operand.
rand()
Returns a random integer value from 0 up to (but not including) the value of the variable the method was invoked on.
toDecimal()
Returns a decimal representation of the integer.
toFloat()
Returns a float representation of the integer.
toString()
Returns a string representation of the integer.
For more information on the integer type, see integer.
listener methods
The following method may be called on variables of listener type:
Method
Result
quit()
Causes the listener to terminate immediately.
For more information on the listener type, see listener.
location methods
The following methods may be called on variables of location type:
Method
Result
canParse(string)
Returns true if the string argument can be successfully parsed.
clone()
Returns a new location that is an exact copy of the location that this method is called on.
expand(float)
Returns a new location expanded by the value of the float parameter in each direction.
inside(location)
Returns true if the location is entirely enclosed by the space defined by the location parameter, false otherwise.
parse(string)
Returns the location instance represented by the string argument.
toString()
Returns a string representation of the location.
For more information on the location type, see location.
optional methods
The methods available to the optional data structure are:
Method
Result
canParse(string)
Returns true if the string argument can be successfully parsed to create an optional object.
clone()
Returns a new optional that is an exact copy of the optional that this method is called on.
empty()
Returns true if the optional is empty.
getOr(alternate)
Returns either the contained value or the alternate if this instance is empty.
getOrThrow()
Returns either the contained value or throws a NullPointerException if this instance contains no value.
parse(string)
Returns the optional object represented by the string argument.
toString()
Creates a string representation of the optional, prefixed with the word optional and parentheses enclosing the element.
For more information on the optional type, see optional.
sequence methods
The methods available to the sequence data structure are:
Method
Result
append(item)
Appends the item to the end of the sequence.
appendSequence(sequence)
Appends the sequence to the end of the sequence that this method is called on.
canParse(string)
This method is available only on sequences where the item type is parseable. Returns true if the string argument can be successfully parsed to create a sequence object.
clear()
Sets the size of the sequence to 0, deleting all entries.
clone()
Returns a new sequence that is an exact copy of the sequence that this method is called on.
indexOf(item)
Returns as an integer the location of the first matching item within the sequence.
insert(item, integer)
Inserts the item specified into the location indicated by the second parameter.
parse(string)
This method is available only on sequences where the item type is parseable. Returns the sequence object represented by the string argument.
remove(integer)
Removes the nth element in the sequence, moving all the elements above it down and reducing the size by 1. In EPL, sequence elements are indexed from 0, that is, the first element is at location 0.
reverse()
Modifies the sequence by reversing the order of the items in the sequence.
setCapacity(integer)
Sets the amount of memory initially allocated for the sequence.
setSize(integer)
Sets the number of elements in the sequence to the specified integer, either deleting entries from the end or adding initialized (using default values of variables) entries to the end.
size()
Returns as an integer the number of elements in the sequence.
sort()
Sorts the sequence it is called on in ascending order.
toString()
Converts the entire sequence to a string.
[integer]
Retrieves or overwrites an existing entry from the sequence, specifically the one located at the index specified. In EPL, sequence elements are indexed from 0, that is, the first element is number 0.
For more information on the sequence type, see sequence.
StackTraceElement methods
The StackTraceElement type is defined in the com.apama.exceptions namespace.
The following methods may be called on values of StackTraceElement type:
Method
Result
getActionName()
Returns a string that contains the name of the action in which the exception occurred.
getFilename()
Returns a string that contains the name of the file that contains the code in which the exception occurred.
getLineNumber()
Returns an integer that indicates the line number of the code in which the exception occurred.
getTypeName()
Returns a string that indicates the type (event, aggregate, monitor) that contains the action in which the exception occurred.
toString()
Returns a string whose format is "typeName.actionName() filename:linenumber".
For more information on the StackTraceElement type, see StackTraceElement.
stream methods
The methods available to the stream type are:
Method
Result
clone()
Returns the original stream. It does not clone it.
quit()
Causes a stream listener to terminate.
For more information on the stream type, see stream.
string methods
The following methods may be called on values of string type:
Method
Result
canParse(string)
Returns true if the string argument can be successfully parsed.
clone(string)
Returns a reference to the specified string.
find(substring)
Returns an integer indicating the index position of the substring passed as parameter to the method.
findFrom(substring, fromIndex)
Behaves like the find() method, but starts searching for the specified substring with the character indicated by fromIndex..
intern()
Marks the string it is called on as interned. Subsequent incoming events that contain a string that is identical to an interned string use the same string object.
join(sequence<string> s)
Concatenates the strings in s using the string it is called on as a separator.
length()
Returns an integer indicating the length of the string.
ltrim()
Returns a string where all whitespace characters at the beginning have been removed.
matches(string regex)
Returns true if the string matches the specified regular expression.
parse(string)
Returns the string value represented by the string argument without enclosing that value in quotation marks. You can call this method on the string type or on an instance of a string type.
replace(string regex, string replacement)
Returns a new string in which the first match that has been found for the specified regular expression has been replaced with the specified replacement string. To replace all matches globally, you have to use (!g) before the regular expression.
replaceAll(string1, string2)
Makes a copy of the string, replaces instances of string1 with instances of string2 and returns the revised string.
rtrim()
Returns a string where all whitespace characters at the end have been removed.
search(string regex)
Returns a sequence<string> containing all non-overlapping matches that have been found for the specified regular expression.
split(string input)
Returns a sequence of the strings that result from splitting the input string on every occurrence of the delimiter string that the method is called on.
substring(integer, integer)
Returns the substring indicated by the integer parameters.
tokenize(string input)
Returns a sequence of all the non-empty strings (tokens) that result from splitting the input string on occurrences of any character from the string that the method is called on. The returned sequence never contains any empty strings, and will have no elements if the input string is empty or contains only delimiters.
toBoolean()
Returns true if the string is "true" and false in all other cases.
toDecimal()
Returns a decimal representation of the string, if the string starts with one or more numeric characters.
toFloat()
Returns a float representation of the string, if the string starts with one or more numeric characters.
toInteger()
Returns an integer representation of the string, if the string starts with one or more numeric characters.
toLower()
Returns an all-lowercase string representation of the string.
toString()
Returns the contents of the string value, exactly the same as using the string directly.
toUpper()
Returns an all-uppercase string representation of the string.
For more information on the string type, see string.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.