...
Code Block | ||
---|---|---|
| ||
use java::util::*;
use de::uniol::inf::is::odysseus::core::ISubscription;
use com::google::common::collect::ImmutableMap;
use static java::lang::System; |
Class, Interface
Besides the integration of Java types it is also possible to create your own classes and interfaces.
...
Methods, constructors and other blocks are sequences of statements. They can be divided into atomic and compound statements. Atomic statements are not made up of other statements and ends end with a semicolon (e.g. VariableStatement). Compound statements (also called control structures) contain other statements (e.g. WhileStatement).
...
A new object can be created by calling a constructor. It is also possible to assign values to attributes in this context. This makes it easier to configure operators when building a query with QDL because it is not necessary to create a new statement for each parameter.
Code Block | ||
---|---|---|
| ||
// Constructor Call Point p1 = new Point(2, 5); Point p2(2,5); // Assigning values attributeto valuesattributes Point p3 = new Point{x = 2, y = 5}; Point p4{x = 2, y = 5}; Select sel{predicate="bid.price <=200"}; Project proj(sel){attributes=[bid.PRICE]}; |
Expressions
An expression is used as part of other expressions or statements and produces a value as result.
...
If a data type has a getter- or setter-method there will always be a corresponding attribute to access. So it is often possible to use assignment expressions instead of method calls.
Code Block | ||
---|---|---|
| ||
Tuple tuple = createTuple();
ITimeInterval time = tuple.metadata;
tuple.metadata = time;
//is equivalent to
ITimeInterval time1 = tuple.getMetadata();
tuple.setMetadata(time1); |
Metadata
Code Block | ||
---|---|---|
| ||
Metadata ::= ID "=" MetadataValue. MetadataValue ::= MetadataValueSingle | MetadataValueList | MetadataValueMap. MetadataValueSingle ::= INTEGER | Double | CHAR | STRING | BOOLEAN | QName. MetadataValueList ::= "[" (MetadataValue ("," MetadataValue)*)? "]". MetadataValueMap ::= "[" (MetadataValueMapEntry ("," MetadataValueMapEntry)*)? "]". MetadataValueMapEntry ::= MetadataValue ":" MetadataValue. |
...