jd.xml.xpath.axis
Class RootAxis

java.lang.Object
  extended byjd.xml.xpath.axis.Axis
      extended byjd.xml.xpath.axis.RootAxis
All Implemented Interfaces:
ModelWalker

public class RootAxis
extends Axis
implements ModelWalker

RootAxis represents the pseudo-axis for the document root.


Field Summary
static Axis INSTANCE
          The axis instance.
 
Method Summary
 XPathNode getFirstNode(XPathNode contextNode, NodeTest nodeTest)
          Return the root.
 int getMaxResultSize(NodeTest nodeTest)
          Return 1.
 int getMinResultSize(NodeTest test)
          Return 1.
 ModelWalker getModelWalker()
          Return this.
 void getNodes(XPathNode contextNode, NodeTest nodeTest, XMutableNodeSet result)
          Add the root to the result set.
 XPathNode gotoFirstNode(XPathNode contextNode)
          Return the root node.
 XPathNode gotoNextNode(XPathNode lastNode)
          Return null.
 
Methods inherited from class jd.xml.xpath.axis.Axis
getName, getPrincipalNodeType, getProximityModelWalker, isDistinctAxis, isForwardAxis, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final Axis INSTANCE
The axis instance.

Method Detail

getMaxResultSize

public int getMaxResultSize(NodeTest nodeTest)
Return 1.

Overrides:
getMaxResultSize in class Axis

getMinResultSize

public int getMinResultSize(NodeTest test)
Return 1.

Overrides:
getMinResultSize in class Axis

getNodes

public void getNodes(XPathNode contextNode,
                     NodeTest nodeTest,
                     XMutableNodeSet result)
Add the root to the result set.

Overrides:
getNodes in class Axis
Parameters:
contextNode - the context node
nodeTest - the node test
result - a nodeset for the matching nodes.

getFirstNode

public XPathNode getFirstNode(XPathNode contextNode,
                              NodeTest nodeTest)
Return the root.

Overrides:
getFirstNode in class Axis

getModelWalker

public ModelWalker getModelWalker()
Return this.

Specified by:
getModelWalker in class Axis

gotoFirstNode

public XPathNode gotoFirstNode(XPathNode contextNode)
Return the root node.

Specified by:
gotoFirstNode in interface ModelWalker
Returns:
the first node of the path represented by this ModelWalker.- If null the path is empty.

gotoNextNode

public XPathNode gotoNextNode(XPathNode lastNode)
Return null.

Specified by:
gotoNextNode in interface ModelWalker
Parameters:
lastNode - a XPathNode obtained from the last call to gotoFirstNode or gotoNextNode. If the node is another node the behaviour is not determined.
Returns:
the next node of the path represented by this ModelWalker.- If null then the path ended.