XES - Programmers Guide - nodeConstant

for information about XES schema see these pages.

Constant

This node is used to hold a single constant value (known as a 'literal'). A nodeConstant holds one of the following types of literal: 'IntegerLiteral', 'FloatingPointLiteral', 'BooleanLiteral', 'CharacterLiteral', 'StringLiteral' or 'NullLiteral'

An integer literal may be expressed in decimal (base 10), hexadecimal (base 16), or octal (base 8):

A floating-point literal consists of two intergers, a mantissa part and an exponent. This may be represented by a number containing a decimal point '.' or an exponent 'e' or both. Both the mantissa and the exponent may have a negative sign.

A boolean literal may have the values 'true' or 'false'.

A character literal contains 'SingleCharacter' or 'EscapeSequence'

Attributes used

Only one of the following attributes may be used: "constantType","intConst","stringValue","floatValue","doubleValue","booleanValue".

Child Elements

The only child elements allowed are comments.

Schema entry

Holds a constant string, integer, floating point or boolean value

	<xs:complexType name="constantType">
<xs:attribute name="intConst" type="xs:int"/>
<xs:attribute name="stringValue" type="xs:string"/>
<xs:attribute name="floatValue" type="xs:float"/>
<xs:attribute name="doubleValue" type="xs:double"/>
<xs:attribute name="booleanValue" type="xs:boolean"/>
</xs:complexType>

Examples of usage

usage java example XES example
integer constant 0; <constant intConst="0"/>
negative integer constant i = -1; <assign operator="=">
<variable name="i"/>
<constant intConst="1"/>
</assign>
long integer 3L; <constant stringConst="3L"/>
floating point constant (default is double) 0.1; <constant doubleConst="0.1"/>
floating point constant, explicitly declaired as float 0.2f; <constant doubleConst="0.2"/>
floating point constant, explicitly declaired as double 0.3d; <constant doubleConst="0.3"/>
floating point with exponent 5e-6; <constant doubleConst="5.0E-6"/>
boolean constant true; <constant boolConst="true"/>
character constant 'c'; <constant stringConst="'c'"/>
unicode character char c = '\uFFFF'; <variable name="c" type="char">
<assign operator="=">
<constant stringConst="'?'"/>
</assign>
</variable>
octal 0777; <constant intConst="777">
hexadecimal 0x7fff; <constant stringConst="0x7fff">
string constant "string"; <constant stringConst="&quot;string&quot;"/>
null reference null; <constant stringConst="null"/>
array initialiser list int v[]={1,2,3,4}; <variable isArray="true" name="v" type="int">
<assign operator="=">
<array>
<constant intConst="1"/>
<constant intConst="2"/>
<constant intConst="3"/>
<constant intConst="4"/>
</array>
</assign>
</variable>

Java

x=3

y ="three"

Scala

val x=3

val y ="three"


metadata block
see also:

 

Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.