hmi.bml.core
Class BehaviourBlock

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.bml.core.BMLElement
          extended by hmi.bml.core.BehaviourBlock
All Implemented Interfaces:
XMLStructure

public class BehaviourBlock
extends BMLElement

This class represents a block of behaviour. This is represented in BML by the <bml>-tag.

Author:
PaulRC

Field Summary
private  Set<String> appendList
           
 ArrayList<Behaviour> behaviours
           
 ArrayList<ConstraintBlock> constraintBlocks
           
private  Set<String> interruptList
           
private  Set<String> onStartList
           
private  boolean prePlan
           
 ArrayList<RequiredBlock> requiredBlocks
           
private  SchedulingMechanism schedulingMechanism
           
private static String XMLTAG
           
 
Fields inherited from class hmi.bml.core.BMLElement
bmlId, id
 
Fields inherited from class hmi.xml.XMLStructureAdapter
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING
 
Constructor Summary
BehaviourBlock()
           
BehaviourBlock(XMLTokenizer tokenizer)
           
 
Method Summary
 StringBuilder appendAttributeString(StringBuilder buf)
          Appends a String to buf that encodes the attributes for the XML encoding.
 StringBuilder appendContent(StringBuilder buf, XMLFormatting fmt)
          Appends a String to buf that encodes the contents for the XML encoding.
 void constructConstraints(BMLParser scheduler)
           
 void decodeAttributes(HashMap<String,String> attrMap, XMLTokenizer tokenizer)
          decodes all attributes.
 void decodeContent(XMLTokenizer tokenizer)
          decodes the XML contents, i.e. the XML between the STag and ETag of the encoding.
 Set<String> getAppendList()
           
 Set<String> getInterruptList()
           
 Set<String> getOnStartList()
           
private  void getParameterList(String str, Set<String> parameterList)
           
 SchedulingMechanism getSchedulingMechanism()
           
 String getXMLTag()
          The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object
 boolean isPrePlanned()
           
 void registerElementsById(BMLParser scheduler)
           
 void registerElementsById(BMLParser scheduler, Breadcrumb breadcrumb)
          Recursively calls resolveIDs(Scheduler, Breadcrumb) on top level behaviours and on required-blocks.
static String xmlTag()
          The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class
 
Methods inherited from class hmi.bml.core.BMLElement
ensureDecodeProgress
 
Methods inherited from class hmi.xml.XMLStructureAdapter
appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttribute, appendAttributes, appendAttributes, appendAttributeString, appendBooleans, appendCloseEmptyTag, appendCloseSTag, appendComment, appendContent, appendDoubleElement, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendEmptyTag, appendETag, appendETag, appendFloatArrayElement, appendFloatElement, appendFloats, appendIntArrayElement, appendIntElement, appendInts, appendLongElement, appendNewLine, appendNewLine, appendNewLine, appendOpenSTag, appendOptionalDoubleElement, appendOptionalFloatElement, appendOptionalIntElement, appendOptionalLongElement, appendSpaces, appendSpaces, appendSTag, appendSTag, appendSTag, appendStringArrayElement, appendStrings, appendSystemNewLine, appendTab, appendTextElement, appendXML, appendXML, appendXML, appendXML, appendXML, appendXMLStructure, appendXMLStructureList, appendXMLTextElementList, countTokens, countTokens, decodeAttribute, decodeAttribute, decodeBoolean, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeBooleanArray, decodeDouble, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeDoubleArray, decodeFloat, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeFloatArray, decodeInt, decodeIntArray, decodeIntArray, decodeIntArray, decodeIntArray, decodeLong, decodeStringArray, decodeStringArray, decodeStringArray, decodeStringArray, decodeXMLStructureList, decodeXMLValueElement, getNamespace, getOptionalAttribute, getOptionalAttribute, getOptionalBooleanAttribute, getOptionalDoubleAttribute, getOptionalFloatAttribute, getOptionalIntAttribute, getOptionalLongAttribute, getRequiredAttribute, getRequiredBooleanAttribute, getRequiredDoubleAttribute, getRequiredFloatAttribute, getRequiredIntAttribute, getRequiredLongAttribute, getTagLine, hasContent, parseXMLElement, postProcess, preProcess, readXML, readXML, readXML, setConsoleAttributeEnabled, setDefaultRecoverMode, setRecoverMode, spaces, toString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

requiredBlocks

public ArrayList<RequiredBlock> requiredBlocks

constraintBlocks

public ArrayList<ConstraintBlock> constraintBlocks

behaviours

public ArrayList<Behaviour> behaviours

appendList

private Set<String> appendList

interruptList

private Set<String> interruptList

onStartList

private Set<String> onStartList

prePlan

private boolean prePlan

schedulingMechanism

private SchedulingMechanism schedulingMechanism

XMLTAG

private static final String XMLTAG
See Also:
Constant Field Values
Constructor Detail

BehaviourBlock

public BehaviourBlock()

BehaviourBlock

public BehaviourBlock(XMLTokenizer tokenizer)
               throws IOException
Throws:
IOException
Method Detail

getAppendList

public Set<String> getAppendList()
Returns:
the an unmodifiable view of the appendList

getOnStartList

public Set<String> getOnStartList()
Returns:
the an unmodifiable view of the onStartList, that is the list of bml blocks that this block should activate

getInterruptList

public Set<String> getInterruptList()
Returns:
the an unmodifiable view of the interruptList

getSchedulingMechanism

public SchedulingMechanism getSchedulingMechanism()

xmlTag

public static String xmlTag()
The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class


getXMLTag

public String getXMLTag()
The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object

Specified by:
getXMLTag in interface XMLStructure
Overrides:
getXMLTag in class BMLElement

appendAttributeString

public StringBuilder appendAttributeString(StringBuilder buf)
Description copied from class: XMLStructureAdapter
Appends a String to buf that encodes the attributes for the XML encoding. When non empty, the attribute string should start with a space character. Hint: call the appendAttribute(StringBuilder buf, String attrName, String attrValue) for every relevant attribute; this takes care of the leading space as well as spaces in between the attributes) MUST BE OVERWRITTEN BY IMPLEMENTATIONS. (The default implementation appends nothing). The encoding should preferably not add newline characters.

Overrides:
appendAttributeString in class BMLElement

getParameterList

private void getParameterList(String str,
                              Set<String> parameterList)

decodeAttributes

public void decodeAttributes(HashMap<String,String> attrMap,
                             XMLTokenizer tokenizer)
Description copied from class: XMLStructureAdapter
decodes all attributes. The default implementation calls decodeAttribute for every attribute in turn. The decodeAttributes method can be reimplemented when attributes must be processed in some particular order.

Overrides:
decodeAttributes in class BMLElement

appendContent

public StringBuilder appendContent(StringBuilder buf,
                                   XMLFormatting fmt)
Description copied from class: XMLStructureAdapter
Appends a String to buf that encodes the contents for the XML encoding. MUST BE OVERWRITTEN BY IMPLEMENTATIONS. (The default implementation appends nothing). The encoding should start on a new line, using indentation equal to tab. There should be no newline after the encoding.

Overrides:
appendContent in class XMLStructureAdapter

decodeContent

public void decodeContent(XMLTokenizer tokenizer)
                   throws IOException
Description copied from class: XMLStructureAdapter
decodes the XML contents, i.e. the XML between the STag and ETag of the encoding. MUST BE OVERWRITTEN BY IMPLEMENTATIONS.

Overrides:
decodeContent in class XMLStructureAdapter
Throws:
IOException

registerElementsById

public void registerElementsById(BMLParser scheduler)

registerElementsById

public void registerElementsById(BMLParser scheduler,
                                 Breadcrumb breadcrumb)
Recursively calls resolveIDs(Scheduler, Breadcrumb) on top level behaviours and on required-blocks.

Overrides:
registerElementsById in class BMLElement

constructConstraints

public void constructConstraints(BMLParser scheduler)

isPrePlanned

public boolean isPrePlanned()