org.apache.commons.configuration.tree.xpath
Class ConfigurationNodeIteratorChildren
java.lang.Object
org.apache.commons.configuration.tree.xpath.ConfigurationNodeIteratorBase
org.apache.commons.configuration.tree.xpath.ConfigurationNodeIteratorChildren
- All Implemented Interfaces:
- org.apache.commons.jxpath.ri.model.NodeIterator
class ConfigurationNodeIteratorChildren
- extends ConfigurationNodeIteratorBase
A specialized iterator implementation for the child nodes of a configuration
node.
- Since:
- 1.3
- Version:
- $Id: ConfigurationNodeIteratorChildren.java 439648 2006-09-02 20:42:10Z oheger $
- Author:
- Oliver Heger
Constructor Summary |
ConfigurationNodeIteratorChildren(org.apache.commons.jxpath.ri.model.NodePointer parent,
org.apache.commons.jxpath.ri.compiler.NodeTest nodeTest,
boolean reverse,
org.apache.commons.jxpath.ri.model.NodePointer startsWith)
Creates a new instance of ConfigurationNodeIteratorChildren
and initializes it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConfigurationNodeIteratorChildren
public ConfigurationNodeIteratorChildren(org.apache.commons.jxpath.ri.model.NodePointer parent,
org.apache.commons.jxpath.ri.compiler.NodeTest nodeTest,
boolean reverse,
org.apache.commons.jxpath.ri.model.NodePointer startsWith)
- Creates a new instance of
ConfigurationNodeIteratorChildren
and initializes it.
- Parameters:
parent
- the parent pointernodeTest
- the test selecting the sub nodesreverse
- the reverse flagstartsWith
- the first element of the iteration
createSubNodeList
protected List createSubNodeList(ConfigurationNode node,
org.apache.commons.jxpath.ri.compiler.NodeTest test)
- Creates the list with sub nodes. This method gets called during
initialization phase. It finds out, based on the given test, which nodes
must be iterated over.
- Parameters:
node
- the current nodetest
- the test object
- Returns:
- a list with the matching nodes
findStartIndex
protected int findStartIndex(ConfigurationNode node,
ConfigurationNode startNode)
- Determines the start position of the iteration. Finds the index of the
given start node in the children of the root node.
- Parameters:
node
- the root nodestartNode
- the start node
- Returns:
- the start node's index
Copyright © 2001-2007 The Apache Software Foundation. All Rights Reserved.