Developing Apama Applications > Apama 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 data 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 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.