com.anji.integration
Class XmlPersistableRun

java.lang.Object
  extended bycom.anji.integration.XmlPersistableRun
All Implemented Interfaces:
XmlPersistable

public class XmlPersistableRun
extends java.lang.Object
implements XmlPersistable

Converts run data to XML presentation format. Complexity, fitness, and speciation are represented with the same XML structure, different stylesheets. A new XmlPersistableRun object should be created new for each use, because it caches the XML it produces, and does not automatically detect changes to the underlying Run object.

Author:
Philip Tucker

Field Summary
static java.lang.String PARAMETER_TAG
          XML parameter tag
static java.lang.String PARAMETERS_TAG
          XML parameters tag
static java.lang.String RUN_TAG
          base XML tag
 
Constructor Summary
XmlPersistableRun(Run aRun)
          ctor; must call init() before using this object
 
Method Summary
protected  void appendToString(boolean includeDtd, java.lang.StringBuffer result)
           
 java.lang.String getName()
           
 java.lang.String getXmld()
           
 java.lang.String getXmlRootTag()
           
 java.lang.String toComplexityString(boolean isRunCompleted)
           
 java.lang.String toFitnessString(boolean isRunCompleted)
           
 java.lang.String toSpeciesString(boolean isRunCompleted)
           
 java.lang.String toString()
           
 java.lang.String toXml()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RUN_TAG

public static final java.lang.String RUN_TAG
base XML tag

See Also:
Constant Field Values

PARAMETERS_TAG

public static final java.lang.String PARAMETERS_TAG
XML parameters tag

See Also:
Constant Field Values

PARAMETER_TAG

public static final java.lang.String PARAMETER_TAG
XML parameter tag

See Also:
Constant Field Values
Constructor Detail

XmlPersistableRun

public XmlPersistableRun(Run aRun)
ctor; must call init() before using this object

Parameters:
aRun -
Method Detail

appendToString

protected void appendToString(boolean includeDtd,
                              java.lang.StringBuffer result)
Parameters:
includeDtd - include DTD tag if true
result - representation of run

toComplexityString

public java.lang.String toComplexityString(boolean isRunCompleted)
Parameters:
isRunCompleted - true iff this is the last call to
Returns:
XML representation of population's complexity throughout run

toFitnessString

public java.lang.String toFitnessString(boolean isRunCompleted)
Parameters:
isRunCompleted - true iff this is the last call to
Returns:
XML representation of population's fitness throughout run

toSpeciesString

public java.lang.String toSpeciesString(boolean isRunCompleted)
Parameters:
isRunCompleted - true iff this is the last call to
Returns:
XML representation of population's species and their size thorughout run

toString

public java.lang.String toString()
See Also:
Object.toString()

toXml

public java.lang.String toXml()
Specified by:
toXml in interface XmlPersistable
Returns:
XML String representation of this object
See Also:
XmlPersistable.toXml()

getXmlRootTag

public java.lang.String getXmlRootTag()
Specified by:
getXmlRootTag in interface XmlPersistable
Returns:
root tag
See Also:
XmlPersistable.getXmlRootTag()

getXmld

public java.lang.String getXmld()
Specified by:
getXmld in interface XmlPersistable
Returns:
id
See Also:
XmlPersistable.getXmld()

getName

public java.lang.String getName()
Returns:
unique run ID