Developing Apama Applications > EPL Reference > Variables > Variable declarations > Reference-type variable declarations > Sequence variable declarations
Sequence variable declarations
A value of type sequence contains a set of data elements or entries that are all of the same type.
SequenceDeclaration
Rule components
The DataType enclosed in angle-brackets defines the type of the element values contained in the sequence. You can use any primitive or reference type.
The Identifier becomes the sequence variable’s name.
When you have a sequence of sequences or a sequence of dictionaries, the possibility that the declaration will contain two adjacent > characters arises. To distinguish them from the right shift operator >>, you must include a space between them.
Examples
sequence <integer> s;
sequence <string> w;
SequenceInitializer
Rule components
A SequenceInitializer is a comma-separated list of expressions enclosed in square brackets. Each expression value becomes an element in the sequence and the initial sequence size is determined by the number of expressions in the initializer.
The expression result types must all match the type specified in the sequence declaration.
Examples
sequence <integer> s := [1, 3, 5, 7, 11, 13, 17];
sequence <string> w := ["one", "three", "five", "seven"];
Copyright © 2013-2015 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.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.