jd.xml.xpath.object
Class XSumNodeSet

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.XSumNodeSet

class XSumNodeSet
extends XMutableNodeSet

A NodeSet which collects only the sum of the number values of the added nodes but does not provide access to the nodes. Used to optimize the sum function.


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
(package private) XSumNodeSet()
           
 
Method Summary
 void addNode(XPathNode node)
          Add a node to the nodeset.
 void addNodes(XNodeSet nodeSet)
          Add another nodeset to this nodeset.
 boolean contains(String value)
          Test if the nodeset contains a node whose stringvalue equals the given value.
 boolean contains(XPathNode node)
          Test if the nodeset contains a node who equals the given node.
 XPathNode getNode(int index)
          Get the node for the given index.
 double getNodeSum()
          Get the sum of the number value of all nodes in this nodeset.
 int getOrdering()
          Return the ordering of this NodeSet.
 boolean isEmpty()
          Return if the nodeset is empty.
 int size()
          Return the size of the NodeSet.
 String toString()
          Return a debug string representation of this XObject.
 
Methods inherited from class jd.xml.xpath.object.XMutableNodeSet
merge, mergeMultiDoc, mergeSingleDoc, sort
 
Methods inherited from class jd.xml.xpath.object.XNodeSet
canConvertTo, compare, compare, compare, compare, compare, compare, compare, getDocId, getType, indexOf, isOrdered, isOrdered, setDocId, setMultiDocId, toBooleanValue, toNodeSet, toNumberValue, toNumberValue, 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

XSumNodeSet

XSumNodeSet()
Method Detail

getOrdering

public int getOrdering()
Description copied from class: XNodeSet
Return the ordering of this NodeSet.

Overrides:
getOrdering in class XNodeSet

size

public int size()
Description copied from class: XNodeSet
Return the size of the NodeSet.

Specified by:
size in class XNodeSet

isEmpty

public boolean isEmpty()
Description copied from class: XNodeSet
Return if the nodeset is empty.

Overrides:
isEmpty in class XNodeSet

getNode

public XPathNode getNode(int index)
Description copied from class: XNodeSet
Get the node for the given index.

Specified by:
getNode in class XNodeSet

getNodeSum

public double getNodeSum()
Description copied from class: XNodeSet
Get the sum of the number value of all nodes in this nodeset.

Overrides:
getNodeSum in class XNodeSet

addNode

public void addNode(XPathNode node)
Description copied from class: XMutableNodeSet
Add a node to the nodeset.

Specified by:
addNode in class XMutableNodeSet

addNodes

public void addNodes(XNodeSet nodeSet)
Description copied from class: XMutableNodeSet
Add another nodeset to this nodeset.

Overrides:
addNodes in class XMutableNodeSet

contains

public boolean contains(XPathNode node)
Description copied from class: XNodeSet
Test if the nodeset contains a node who equals the given node.

Overrides:
contains in class XNodeSet

contains

public boolean contains(String value)
Description copied from class: XNodeSet
Test if the nodeset contains a node whose stringvalue equals the given value.

Overrides:
contains in class XNodeSet

toString

public String toString()
Return a debug string representation of this XObject.

Overrides:
toString in class XNodeSet