com.ibm.are.common
Class XmlUtils.SingleNode

java.lang.Object
  extended by com.ibm.are.common.XmlUtils.SingleNode
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
XmlUtils

protected static class XmlUtils.SingleNode
extends java.lang.Object
implements java.lang.Comparable

The SingleNode class encapsulates a single XML node as well as a string value. The string value is used to alphabetically sort the node, relative to its other siblings.

Version:
1.0
Author:
IBM

Field Summary
static java.lang.String COPYRIGHT
          Copyright for class bytecode
 
Constructor Summary
XmlUtils.SingleNode(org.w3c.dom.Node theNode, java.lang.String sortFieldValue)
          Constructs a SingleNode object that represents the specified node and contains the specified string to be used when sorting the XML nodes.
 
Method Summary
 int compareTo(java.lang.Object otherObj)
          Compares the sort string to another node's sort string
 org.w3c.dom.Node getNode()
          Retrieves the XML node represented by this object
 java.lang.String getSortFieldValue()
          Retrieves the string to use for sorting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright for class bytecode

See Also:
Constant Field Values
Constructor Detail

XmlUtils.SingleNode

public XmlUtils.SingleNode(org.w3c.dom.Node theNode,
                           java.lang.String sortFieldValue)
Constructs a SingleNode object that represents the specified node and contains the specified string to be used when sorting the XML nodes.

Parameters:
theNode - The XML node represented by this object
sortFieldValue - The string to use when sorting the XML nodes
Method Detail

getSortFieldValue

public java.lang.String getSortFieldValue()
Retrieves the string to use for sorting

Returns:
The string to use for sorting

getNode

public org.w3c.dom.Node getNode()
Retrieves the XML node represented by this object

Returns:
The XML node represented by this object

compareTo

public int compareTo(java.lang.Object otherObj)
Compares the sort string to another node's sort string

Specified by:
compareTo in interface java.lang.Comparable
Returns:
zero if the two strings are equal, a negative number if the sort string in this class is before the specified sort string, or a positive number if the specified sort string is before the sort string in this class.