hmi.animation
Class ConfigList

java.lang.Object
  extended by hmi.xml.XMLStructureAdapter
      extended by hmi.animation.ConfigList
All Implemented Interfaces:
XMLStructure, Cloneable

public class ConfigList
extends XMLStructureAdapter
implements Cloneable

A ConfigList defines a sequence of configurations of type float[] plus corresponding timestamps of type double.


Field Summary
private  int arraySize
           
private  float[][] configList
           
private  int configSize
           
private static int DEFAULTARRAYSIZE
           
private  int listSize
           
private  double[] time
           
private static String XMLTAG
           
 
Fields inherited from class hmi.xml.XMLStructureAdapter
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING
 
Constructor Summary
ConfigList(int configSize)
           
ConfigList(XMLTokenizer tokenizer)
           
 
Method Summary
 void addConfig(double t, float[] conf)
          Adds a VPartsConfig at the appropriate place, depending on the time value The value is inserted at the position determined by findLowerIndex(time) + 1.
 StringBuilder appendAttributeString(StringBuilder buf, XMLFormatting fmt)
          Appends a String of signature attributes to buf
 StringBuilder appendContent(StringBuilder buf, XMLFormatting fmt)
          Appends the config elements as XML content.
 ConfigList clone()
          removes configList[index]..configList[index+width-1] from the list
 boolean decodeAttribute(String attrName, String valCode, XMLTokenizer tokenizer)
          Decodes a single attribute
 void decodeContent(String data)
           
 void decodeContent(XMLTokenizer xmlTokenizer)
          Decodes XML content, and converts it into the double time values and float cofig data.
private  void ensureArraySize(int requestedSize)
           
private  int findInsertIndex(double t)
           
 float[] getConfig(int i)
          Returns the Config at index i
 int getConfigSize()
          Returns the (uniform) size of configs, in number of floats.
 double getEndTime()
           
 double getStartTime()
           
 double getTime(int i)
          Returns the time for config i
 String getXMLTag()
          The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object
 void mirror(int index)
           
 int size()
          returns the size of the list
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.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, decodeAttributes, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

time

private double[] time

configList

private float[][] configList

listSize

private int listSize

arraySize

private int arraySize

DEFAULTARRAYSIZE

private static final int DEFAULTARRAYSIZE
See Also:
Constant Field Values

configSize

private int configSize

XMLTAG

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

ConfigList

public ConfigList(int configSize)

ConfigList

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

clone

public ConfigList clone()
removes configList[index]..configList[index+width-1] from the list

Overrides:
clone in class Object

getConfigSize

public int getConfigSize()
Returns the (uniform) size of configs, in number of floats.


size

public int size()
returns the size of the list


getTime

public double getTime(int i)
Returns the time for config i


mirror

public void mirror(int index)

getConfig

public float[] getConfig(int i)
Returns the Config at index i


getStartTime

public double getStartTime()

getEndTime

public double getEndTime()

addConfig

public void addConfig(double t,
                      float[] conf)
Adds a VPartsConfig at the appropriate place, depending on the time value The value is inserted at the position determined by findLowerIndex(time) + 1.


ensureArraySize

private void ensureArraySize(int requestedSize)

findInsertIndex

private final int findInsertIndex(double t)

appendAttributeString

public StringBuilder appendAttributeString(StringBuilder buf,
                                           XMLFormatting fmt)
Appends a String of signature attributes to buf

Overrides:
appendAttributeString in class XMLStructureAdapter

decodeAttribute

public boolean decodeAttribute(String attrName,
                               String valCode,
                               XMLTokenizer tokenizer)
Decodes a single attribute

Overrides:
decodeAttribute in class XMLStructureAdapter

appendContent

public StringBuilder appendContent(StringBuilder buf,
                                   XMLFormatting fmt)
Appends the config elements as XML content.

Overrides:
appendContent in class XMLStructureAdapter

decodeContent

public void decodeContent(XMLTokenizer xmlTokenizer)
                   throws IOException
Decodes XML content, and converts it into the double time values and float cofig data.

Overrides:
decodeContent in class XMLStructureAdapter
Throws:
IOException

decodeContent

public void decodeContent(String data)

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 XMLStructureAdapter