Synalyze It!  1.1
 All Classes Functions Pages
Public Member Functions | List of all members
Element Class Reference

The Element class. More...

Inheritance diagram for Element:
NumberElement StringElement StructureElement

Public Member Functions

Element Element (ELEMENT_TYPE type, String name, BOOL setDefaults)
 Constructor. Create object of type Element.
 
String getName ()
 Get name. Get name of element.
 
 setName (String name)
 Set name. Set name of element.
 
String getDescription ()
 Get description. Get description of element.
 
 setDescription (String name)
 Set description. Set description of element.
 
String getEnclosingStructure ()
 Get enclosing structure. Get the enclosing structure of the element.
 
String getLength ()
 Get length. Get length of element. For binary or string elements a length of zero means to fill the enclosing structure. Be aware that lengths can be fractions of bytes so call additionally getLengthUnit()
 
LENGTH_UNIT getLengthUnit ()
 Get length unit. Get length unit of element in bits. Valid values are.
 
 setLength (String length, LENGTH_UNIT lengthUnit)
 Set length. Set length of element. For binary or string elements a length of zero means to fill the enclosing structure. The length can contain variables and expressions. For number and binary elements you can specify a length unit .
 
ELEMENT_TYPE getType ()
 Get type. Get type of element. This can be one of.
 
BOOL mustMatch ()
 Get "must match" flag. Get if this element has to match while parsing a file. For this check the min/max values are checked and if one of the fixed values matches (if at least one is defined)
 
 setMustMatch (BOOL mustMatch)
 Set "must match" flag. Set if this element has to match while parsing a file. For this check the min/max values are checked and if one of the fixed values matches (if at least one is defined)
 
Value getMinValue ()
 Get minimum value. Get minimum value of element. This is only valid for numbers. This value will be checked if the "must match" flag is set.
 
Element getParent ()
 Get parent. Get parent of element. There is only a parent element if the enclosing structure is inherited from another structure.
 

Detailed Description

The Element class.

An element object represents one item in a structure.

Author
Andreas Pehnack

Constructor & Destructor Documentation

Element Element ( ELEMENT_TYPE  type,
String  name,
BOOL  setDefaults 
)

Constructor. Create object of type Element.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]typeThe type of the element
[in]nameThe name of the element
[in]setDefaultsSet defaults for element?
Returns
The new element

Member Function Documentation

String getDescription ( )

Get description. Get description of element.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The description of the element
See Also
setDescription
String getEnclosingStructure ( )

Get enclosing structure. Get the enclosing structure of the element.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The structure the element is part of
String getLength ( )

Get length. Get length of element. For binary or string elements a length of zero means to fill the enclosing structure. Be aware that lengths can be fractions of bytes so call additionally getLengthUnit()

Author
Andreas Pehnack
Date
2012-05-11
Returns
The length of the element in bytes.
See Also
getLengthUnit
LENGTH_UNIT getLengthUnit ( )

Get length unit. Get length unit of element in bits. Valid values are.

  • LENGTH_UNIT_BYTES
  • LENGTH_UNIT_BITS
Author
Andreas Pehnack
Date
2012-05-11
Returns
The length of the element in bits.
See Also
getLength
Value getMinValue ( )

Get minimum value. Get minimum value of element. This is only valid for numbers. This value will be checked if the "must match" flag is set.

Get maximum value. Get maximum value of element. This is only valid for numbers. This value will be checked if the "must match" flag is set.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The minimum value of the element.
See Also
getMaxValue
Author
Andreas Pehnack
Date
2012-05-11
Returns
The maximum value of the element.
See Also
getMinValue
String getName ( )

Get name. Get name of element.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The name of the element
See Also
setName
Element getParent ( )

Get parent. Get parent of element. There is only a parent element if the enclosing structure is inherited from another structure.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The parent of the element.
ELEMENT_TYPE getType ( )

Get type. Get type of element. This can be one of.

  • ELEMENT_BINARY
  • ELEMENT_GRAMMAR_REF
  • ELEMENT_NUMBER
  • ELEMENT_STRING
  • ELEMENT_OFFSET
  • ELEMENT_SCRIPT
  • ELEMENT_STRUCTURE
  • ELEMENT_STRUCTURE_REF
Author
Andreas Pehnack
Date
2012-05-11
Returns
The type of the element.
BOOL mustMatch ( )

Get "must match" flag. Get if this element has to match while parsing a file. For this check the min/max values are checked and if one of the fixed values matches (if at least one is defined)

Author
Andreas Pehnack
Date
2012-05-11
Returns
Does the element have to match while parsing?
See Also
setMustMatch
setDescription ( String  name)

Set description. Set description of element.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]nameThe new description of the element
See Also
getDescription
setLength ( String  length,
LENGTH_UNIT  lengthUnit 
)

Set length. Set length of element. For binary or string elements a length of zero means to fill the enclosing structure. The length can contain variables and expressions. For number and binary elements you can specify a length unit .

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]lengthThe new length of the element
[in]lengthUnitThe new length unit (bits/bytes) of the element
See Also
getLengthUnit
setMustMatch ( BOOL  mustMatch)

Set "must match" flag. Set if this element has to match while parsing a file. For this check the min/max values are checked and if one of the fixed values matches (if at least one is defined)

Author
Andreas Pehnack
Date
2012-05-15
See Also
mustMatch
setName ( String  name)

Set name. Set name of element.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]nameThe new name of the element
See Also
getName

The documentation for this class was generated from the following file: