org.apache.commons.configuration.tree.xpath
abstract class ConfigurationNodeIteratorBase extends Object implements NodeIterator
A base class for implementing iterators over configuration nodes.
This class already provides common functionality for implementing the iteration process. Derived classes will implement specific behavior based on the concrete node type (child node or attribute node).
Since: 1.3
Version: $Id: ConfigurationNodeIteratorBase.java 439648 2006-09-02 20:42:10Z oheger $
Field Summary | |
---|---|
NodePointer | parent Stores the parent node pointer. |
int | position Stores the current position. |
boolean | reverse Stores the reverse flag. |
int | startOffset Stores the start offset of the iterator. |
List | subNodes Stores the list with the sub nodes. |
Constructor Summary | |
---|---|
protected | ConfigurationNodeIteratorBase(NodePointer parent, boolean reverse)
Creates a new instance of ConfigurationNodeIteratorBase
and initializes it.
|
Method Summary | |
---|---|
protected NodePointer | createNodePointer(ConfigurationNode node)
Creates the configuration node pointer for the current position. |
protected int | getMaxPosition()
Returns the maximum position for this iterator.
|
NodePointer | getNodePointer()
Returns the current node pointer.
|
protected NodePointer | getParent()
Returns the parent node pointer.
|
int | getPosition()
Returns the position of the iteration.
|
protected int | getStartOffset()
Returns the start offset of the iteration.
|
protected void | initSubNodeList(List nodes)
Initializes the list of sub nodes for the iteration. |
protected int | positionToIndex(int pos)
Returns the index in the data list for the given position. |
boolean | setPosition(int pos)
Sets the position of the iteration.
|
protected void | setStartOffset(int startOffset)
Sets the start offset of the iteration. |
ConfigurationNodeIteratorBase
and initializes it.
Parameters: parent the parent pointer reverse the reverse flag
getNodePointer()
. Derived classes
must create the correct pointer object.
Parameters: node the current configuration node
Returns: the node pointer
Returns: the maximum allowed position
Returns: the current pointer in this iteration
Returns: the parent node pointer
Returns: the position
Returns: the start offset
Parameters: nodes the list with the sub nodes
Parameters: pos the position (1-based)
Returns: the corresponding list index
Parameters: pos the new position
Returns: a flag if this is a valid position
Parameters: startOffset the start offset