Developing Apama Applications > Apama EPL Reference > Types > Type methods and instance methods
Type methods and instance methods
There are two kinds of inbuilt methods — type methods and instance methods. Type methods are associated with data types. Instance methods are associated with values.
Type methods
To call a type method, you specify the name of the data type followed by a period, followed by the method name with its parameters enclosed in parentheses. Some methods do not have parameters and for them you must supply an empty parameter list.
TypeMethodCall
CommonTypeMethodCall
Examples
event someEvent;
{   
integer n;
}
integer i;
i:=integer.getUnique();
print someEvent.getName();
Instance methods
Each data type (except action), whether primitive or reference, has a number of instance methods that provide a number of useful functions and operations on instance variables of that type. These methods are quite similar to actions except that they are predefined and associated with variables, not monitors or events.
InstanceMethodCall
To call an instance method, you specify an expression followed by a period and the name of the method, followed by a parenthesized list of actual parameters or arguments to be passed to the method when it is called.
Example
integer i := 642;
float f;
f := i.toFloat ();
print f.formatFixed (5);
The ExpressionReference can be a simple variable name or a more complicated expression that includes a namespace, action or method calls, literals, subscript operators and so on.
The InstanceMethodName is the name of a method that is specific to the data type of the variable. The ActualParameterList syntax is described in Action and method calls.
Some methods do not have parameters and for those, you must supply an empty argument list as follows: methodname ().
See Also
See the following sections for the methods you can call on types and instances:
*boolean
*float
*integer
*string
*action
*context
*dictionary
*event
*listener
*location
*sequence
*stream
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.