org.mmtk.utility.statistics
Class Xml

java.lang.Object
  extended by org.mmtk.utility.statistics.Xml

public class Xml
extends Object

Utility class for writing statistics out in XML format.


Constructor Summary
Xml()
           
 
Method Summary
static void attribute(String name, boolean value)
          Add a boolean-valued attribute to an open XML tag.
static void attribute(String name, byte[] value)
          Add a byte[]-valued attribute to an open XML tag.
static void attribute(String name, double value)
          Add a double-valued attribute to an open XML tag.
static void attribute(String name, int value)
          Add an int-valued attribute to an open XML tag.
static void attribute(String name, long value)
          Add a long-valued attribute to an open XML tag.
static void attribute(String name, String value)
          Add a String-valued attribute to an open XML tag.
static void attribute(String name, Word value)
          Add a word-valued attribute to an open XML tag.
static void begin()
          Mark the start of XML output
static void closeAttribute()
          Close an attribute (actually a simple close-quote)
static void closeComment()
          Close an XML comment
static void closeMinorTag()
          Close a tag with a "/>"
static void closeTag(boolean close)
          End a tag, optionally closing it (if it is a simple entity)
static void closeTag(boolean close, boolean endLine)
          End a tag, optionally closing it (if it is a simple entity), and optionally printing end-of-line
static void closeTag(String name)
          Close the innermost XML tag and pop it from the stack.
static void comment(String comment)
          Add a comment, bracketing it with open- and close-comment tags.
static void configItem(String name, boolean value)
          Output a "config" entity, with a given name and booleanvalue.
static void configItem(String name, String value)
          Output a "config" entity, with a given name and Stringvalue.
static void end()
          Mark the end of XML output
static void openAttribute(String name)
          Open an attribute (write "{name}=\")
static void openComment()
          Open an XML comment
static void openMinorTag(String name)
          Open a tag without pushing it on the tag stack - must end this with a call to closeMinorTag()
(package private) static void openTag(String name)
          Open a simple XML entity.
(package private) static void openTag(String name, boolean endTag)
          Open an XML tag.
static void singleValue(String name, double value)
          Convenience version of singleValue where units are not specified.
static void singleValue(String name, double value, String units)
          Output a "stat" entity, with a given name, doublevalue and optionally, units.
static void singleValue(String name, long value)
          Convenience version of singleValue where units are not specified.
static void singleValue(String name, long value, String units)
          Output a "stat" entity, with a given name, long value and optionally, units.
static void startTag()
          Start a tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Xml

public Xml()
Method Detail

begin

public static void begin()
Mark the start of XML output


end

public static void end()
Mark the end of XML output


closeTag

public static void closeTag(String name)
Close the innermost XML tag and pop it from the stack.


openTag

static void openTag(String name,
                    boolean endTag)
Open an XML tag.

Parameters:
name - Tag name
endTag - Should the tag be closed, or left open for adding additional attributes

openTag

static void openTag(String name)
Open a simple XML entity.

Parameters:
name - Name of the entity

singleValue

public static void singleValue(String name,
                               double value,
                               String units)
Output a "stat" entity, with a given name, doublevalue and optionally, units.

Parameters:
name - Name of the entity
value - The value of the entity
units - The units, or null for no units.

singleValue

public static void singleValue(String name,
                               double value)
Convenience version of singleValue where units are not specified.

Parameters:
name - Name of the entity
value - The value of the entity

configItem

public static void configItem(String name,
                              boolean value)
Output a "config" entity, with a given name and booleanvalue.

Parameters:
name - Name of the entity
value - The value of the entity

configItem

public static void configItem(String name,
                              String value)
Output a "config" entity, with a given name and Stringvalue.

Parameters:
name - Name of the entity
value - The value of the entity

singleValue

public static void singleValue(String name,
                               long value,
                               String units)
Output a "stat" entity, with a given name, long value and optionally, units.

Parameters:
name - Name of the entity
value - The value of the entity
units - The units, or null for no units.

singleValue

public static void singleValue(String name,
                               long value)
Convenience version of singleValue where units are not specified.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             Word value)
Add a word-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             byte[] value)
Add a byte[]-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             String value)
Add a String-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             boolean value)
Add a boolean-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             double value)
Add a double-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             long value)
Add a long-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

attribute

public static void attribute(String name,
                             int value)
Add an int-valued attribute to an open XML tag.

Parameters:
name - Name of the entity
value - The value of the entity

closeAttribute

public static void closeAttribute()
Close an attribute (actually a simple close-quote)


openAttribute

public static void openAttribute(String name)
Open an attribute (write "{name}=\")

Parameters:
name - Name of the entity

startTag

public static void startTag()
Start a tag


closeTag

public static void closeTag(boolean close)
End a tag, optionally closing it (if it is a simple entity)

Parameters:
close - If true, close the tag with "/>" rather than ">"

closeTag

public static void closeTag(boolean close,
                            boolean endLine)
End a tag, optionally closing it (if it is a simple entity), and optionally printing end-of-line

Parameters:
close - If true, close the tag with "/>" rather than ">"
endLine - If true end the current line.

closeMinorTag

public static void closeMinorTag()
Close a tag with a "/>"


openMinorTag

public static void openMinorTag(String name)
Open a tag without pushing it on the tag stack - must end this with a call to closeMinorTag()

Parameters:
name - Name of the entity

openComment

public static void openComment()
Open an XML comment


closeComment

public static void closeComment()
Close an XML comment


comment

public static void comment(String comment)
Add a comment, bracketing it with open- and close-comment tags.

Parameters:
comment - The comment.