Java Reference
In-Depth Information
return type (that is, the return type is Void). If you need to call such operations,
you can use the chain expression, with this syntax:
anExpression -> anotherExpression -> lastExpression
Each expression is evaluated in sequence, but only the result of the last
expression is returned. For example:
person.setName('test') -> person
This chain expression sets the name of the person first, before it returns the
person object itself.
Create Expression
The create expression instantiates new objects of a given type:
new Topic
Let Expression
The let expression lets you define local variables. The syntax is as follows:
let v = expression : expression-with-v
This is especially useful together with a chain and a create expression. For
example:
Topic newTopic() :
let t = new Topic : t.setName('A topic') -> t
;
Casting
The expression language is statically type checked, although sometimes it's nec-
essary to perform a cast. The syntax for casts is very Java-like:
((String)unTypedList.get(0)).toUpperCase()
Search WWH ::




Custom Search