jd.xml.xpath.object
Class XSingleNodeSet

java.lang.Object
  extended byjd.xml.xpath.object.XObject
      extended byjd.xml.xpath.object.XNodeSet
          extended byjd.xml.xpath.object.XMutableNodeSet
              extended byjd.xml.xpath.object.XSingleNodeSet

public class XSingleNodeSet
extends XMutableNodeSet

A XNodeSet which contains one or zero nodes.


Field Summary
 
Fields inherited from class jd.xml.xpath.object.XNodeSet
ORDER_CONVERTIBLE, ORDER_COUNTED, ORDER_ORDERED, ORDER_SUMMARIZED, ORDER_UNORDERED
 
Fields inherited from class jd.xml.xpath.object.XObject
TYPE_BOOLEAN, TYPE_NODESET, TYPE_NUMBER, TYPE_STRING, TYPE_VARIABLE, TYPES
 
Constructor Summary
XSingleNodeSet()
          Create an empty XSingleNodeSet.
XSingleNodeSet(XPathNode node)
          Create a XSingleNodeSet with one node.
 
Method Summary
 void addNode(XPathNode node)
          Add a node to the nodeset.
 XPathNode getNode(int index)
          Return the node for the given index (which should be 0).
 boolean isEmpty()
          Return if the node-set contains one node.
 int size()
          Return 0 or 1.
 
Methods inherited from class jd.xml.xpath.object.XMutableNodeSet
addNodes, merge, mergeMultiDoc, mergeSingleDoc, sort
 
Methods inherited from class jd.xml.xpath.object.XNodeSet
canConvertTo, compare, compare, compare, compare, compare, compare, compare, contains, contains, getDocId, getNodeSum, getOrdering, getType, indexOf, isOrdered, isOrdered, setDocId, setMultiDocId, toBooleanValue, toNodeSet, toNumberValue, toNumberValue, toString, toStringValue, toStringValue, toValue, toValue
 
Methods inherited from class jd.xml.xpath.object.XObject
compare, equals, getTypeName, getTypeName, hashCode, toXObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSingleNodeSet

public XSingleNodeSet()
Create an empty XSingleNodeSet.


XSingleNodeSet

public XSingleNodeSet(XPathNode node)
Create a XSingleNodeSet with one node.

Method Detail

size

public int size()
Return 0 or 1.

Specified by:
size in class XNodeSet

isEmpty

public boolean isEmpty()
Return if the node-set contains one node.

Overrides:
isEmpty in class XNodeSet

addNode

public void addNode(XPathNode node)
Add a node to the nodeset.

Specified by:
addNode in class XMutableNodeSet

getNode

public XPathNode getNode(int index)
Return the node for the given index (which should be 0).

Specified by:
getNode in class XNodeSet