Additional objects
This section presents additional objects in the XL language.
Module
Modules are base nodes used in XL models. They extends Node by default, but can extend another object if specified. To be used in a project modules are classes defined with:
- A public constructor with all its fields as variables
- Fields for each of the module attributes
- Accessor methods for these fields
- A parametrized pattern with all of its attributes as variable
Pattern
Patterns are declared from a class that extends UserDefinedPattern. Each concrete subclass of UserDefinedPattern declares a user-defined pattern, where the term “user-defined” distinguishes such a pattern from built-in patterns of the XL programming language. The signature (number and types of parameters) of a user-defined pattern is given by a special method named signature which has no further purpose. The @In and @Out annotations in the signature are needed when textually neighboring patterns are connected.
Scale
scaleclass A() {}
Generators
For the XL language, a generator expression is an expression that can produce multiple values. These generator are following the design of internal iterators. The XL programming language defines several types of generator expressions. Additionally to the expressions described bellow, expressions of type java.lang.Iterable can also be used as generator expressions, they yield all values of the corresponding external iterator.
Aggregates
Generator expressions provide a convenient and efficient means to yield multiple values. Their counterpart are aggregate expressions which take multiple values in succession as input and produce a single value as result, e. g., the sum of all values. The XL programming language defines a single built-in aggregating operator (the containment operator) and a mechanism for aggregate methods.
