hmi.bml.core
Class Behaviour

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.bml.core.BMLElement
          extended by hmi.bml.core.Behaviour
All Implemented Interfaces:
XMLStructure
Direct Known Subclasses:
BMLTBehaviour, BMLTInterruptBehaviour, FaceBehaviour, GazeBehaviour, GestureBehaviour, HeadBehaviour, LipsBehaviour, LocomotionBehaviour, PostureBehaviour, SpeechBehaviour, WaitBehaviour

public abstract class Behaviour
extends BMLElement

This class is a superclass for all behaviors. It has no representation in BML. It holds common variables. Note that not all elements of BML have this class as superclass: there are tags that are not behaviors.

Author:
PaulRC

Field Summary
 Behaviour descBehaviour
           
private  int descPriority
           
private  ArrayList<Description> descriptions
           
private  SyncPoint start
           
private  ArrayList<SyncPoint> syncPoints
           
 float timeOffset
           
 
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
Behaviour()
           
 
Method Summary
 void addDefaultSyncPoints()
           
 void addSyncPoint(SyncPoint syncPoint)
           
 void addSyncPoints(List<SyncPoint> points)
           
 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(String bbId, 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.
abstract  float getFloatParameterValue(String name)
           
 SyncPoint getStartSyncPoint()
           
abstract  String getStringParameterValue(String name)
           
 ArrayList<SyncPoint> getSyncPoints()
           
 boolean hasContent()
          returns whether the XML encoding should have an contents part, or should be an empty element tag.
 void removeSyncPoints(List<SyncPoint> points)
           
 boolean satisfiesConstraint(String name, String value)
           
abstract  boolean specifiesParameter(String name)
          Does the behavior prescribe a value for parameter with name name?
 
Methods inherited from class hmi.bml.core.BMLElement
ensureDecodeProgress, getXMLTag, registerElementsById, xmlTag
 
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, 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

syncPoints

private ArrayList<SyncPoint> syncPoints

descriptions

private ArrayList<Description> descriptions

start

private SyncPoint start

descBehaviour

public Behaviour descBehaviour

descPriority

private int descPriority

timeOffset

public float timeOffset
Constructor Detail

Behaviour

public Behaviour()
Method Detail

getFloatParameterValue

public abstract float getFloatParameterValue(String name)

getStringParameterValue

public abstract String getStringParameterValue(String name)

specifiesParameter

public abstract boolean specifiesParameter(String name)
Does the behavior prescribe a value for parameter with name name?


satisfiesConstraint

public boolean satisfiesConstraint(String name,
                                   String value)

getStartSyncPoint

public SyncPoint getStartSyncPoint()

addDefaultSyncPoints

public void addDefaultSyncPoints()

addSyncPoint

public void addSyncPoint(SyncPoint syncPoint)

removeSyncPoints

public void removeSyncPoints(List<SyncPoint> points)

addSyncPoints

public void addSyncPoints(List<SyncPoint> points)

getSyncPoints

public ArrayList<SyncPoint> getSyncPoints()

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

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

hasContent

public boolean hasContent()
Description copied from class: XMLStructureAdapter
returns whether the XML encoding should have an contents part, or should be an empty element tag. This method should be overwritten if necessary in classes that inherit from XMLStructureAdapter. The default implementation returns always true.

Overrides:
hasContent in class XMLStructureAdapter

constructConstraints

public void constructConstraints(String bbId,
                                 BMLParser scheduler)