org.processmining.framework.models.protos
Class ProtosUtil

java.lang.Object
  extended by org.processmining.framework.models.protos.ProtosUtil

public class ProtosUtil
extends java.lang.Object

Title: Protos utilities

Description:

Copyright: Copyright (c) 2004

Company:

Version:
1.0
Author:
Eric Verbeek

Constructor Summary
ProtosUtil()
           
 
Method Summary
static boolean readBool(org.w3c.dom.Node node)
          Returns the boolean value represented by the contents of the given node.
static double readDouble(org.w3c.dom.Node node)
          Returns the double value represented by the contents of the given node.
static float readFloat(org.w3c.dom.Node node)
          Returns the float value represented by the contents of the given node.
static int readInt(org.w3c.dom.Node node)
          Returns the int value represented by the contents of the given node.
static java.lang.String readString(org.w3c.dom.Node node)
          Returns the contents of the given node.
static java.lang.String writeBool(java.lang.String tag, boolean value)
          Tags (XML-style) the given value with the given tag.
static java.lang.String writeDouble(java.lang.String tag, double value)
          Tags (XML-style) the given value with the given tag.
static java.lang.String writeFloat(java.lang.String tag, float value)
          Tags (XML-style) the given value with the given tag.
static java.lang.String writeInt(java.lang.String tag, int value)
          Tags (XML-style) the given value with the given tag.
static java.lang.String writeString(java.lang.String tag, java.lang.String value)
          Tags (XML-style) the given value with the given tag.
static java.lang.String writeStringIfNonEmpty(java.lang.String tag, java.lang.String value)
          Tags (XML-style) the given value with the given tag, if the given value is non-empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtosUtil

public ProtosUtil()
Method Detail

readString

public static java.lang.String readString(org.w3c.dom.Node node)
Returns the contents of the given node.

Parameters:
node - Node The fiven node.
Returns:
String Its contents.

readBool

public static boolean readBool(org.w3c.dom.Node node)
Returns the boolean value represented by the contents of the given node.

Parameters:
node - Node The given node.
Returns:
boolean Its boolean value.

readInt

public static int readInt(org.w3c.dom.Node node)
Returns the int value represented by the contents of the given node.

Parameters:
node - Node The given node.
Returns:
int Its int value.

readFloat

public static float readFloat(org.w3c.dom.Node node)
Returns the float value represented by the contents of the given node.

Parameters:
node - Node The given node.
Returns:
float Its float value.

readDouble

public static double readDouble(org.w3c.dom.Node node)
Returns the double value represented by the contents of the given node.

Parameters:
node - Node The given node.
Returns:
double Its double value.

writeString

public static java.lang.String writeString(java.lang.String tag,
                                           java.lang.String value)
Tags (XML-style) the given value with the given tag.

Parameters:
tag - String The given tag.
value - String The given value.
Returns:
String The tagged value.

writeStringIfNonEmpty

public static java.lang.String writeStringIfNonEmpty(java.lang.String tag,
                                                     java.lang.String value)
Tags (XML-style) the given value with the given tag, if the given value is non-empty.

Parameters:
tag - String The given tag.
value - String The given value.
Returns:
String The tagged value, if non-empty. Otherwise the empty string..

writeInt

public static java.lang.String writeInt(java.lang.String tag,
                                        int value)
Tags (XML-style) the given value with the given tag.

Parameters:
tag - String The given tag.
value - int The given value.
Returns:
String The tagged value.

writeBool

public static java.lang.String writeBool(java.lang.String tag,
                                         boolean value)
Tags (XML-style) the given value with the given tag.

Parameters:
tag - String The given tag.
value - boolean The given value.
Returns:
String The tagged value.

writeFloat

public static java.lang.String writeFloat(java.lang.String tag,
                                          float value)
Tags (XML-style) the given value with the given tag.

Parameters:
tag - String The given tag.
value - float The given value.
Returns:
String The tagged value.

writeDouble

public static java.lang.String writeDouble(java.lang.String tag,
                                           double value)
Tags (XML-style) the given value with the given tag.

Parameters:
tag - String The given tag.
value - double The given value.
Returns:
String The tagged value.