org.apache.commons.jxpath.ri.model.beans
Class CollectionNodeIterator

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.model.beans.CollectionNodeIterator
All Implemented Interfaces:
NodeIterator
Direct Known Subclasses:
CollectionAttributeNodeIterator, CollectionChildNodeIterator

public abstract class CollectionNodeIterator
extends java.lang.Object
implements NodeIterator

Combines node iterators of all elements of a collection into one aggregate node iterator.

Version:
$Revision: 1.3 $ $Date: 2004/02/29 14:17:41 $
Author:
Dmitri Plotnikov

Field Summary
private  java.util.List collection
           
private  CollectionPointer pointer
           
private  int position
           
private  boolean reverse
           
private  NodePointer startWith
           
 
Constructor Summary
protected CollectionNodeIterator(CollectionPointer pointer, boolean reverse, NodePointer startWith)
           
 
Method Summary
protected abstract  NodeIterator getElementNodeIterator(NodePointer elementPointer)
          Implemened by subclasses to produce child/attribute node iterators.
 NodePointer getNodePointer()
           
 int getPosition()
           
private  void prepare()
           
 boolean setPosition(int position)
          Sets the new current position and returns true if there a node at that position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pointer

private CollectionPointer pointer

reverse

private boolean reverse

startWith

private NodePointer startWith

position

private int position

collection

private java.util.List collection
Constructor Detail

CollectionNodeIterator

protected CollectionNodeIterator(CollectionPointer pointer,
                                 boolean reverse,
                                 NodePointer startWith)
Method Detail

getElementNodeIterator

protected abstract NodeIterator getElementNodeIterator(NodePointer elementPointer)
Implemened by subclasses to produce child/attribute node iterators.


getPosition

public int getPosition()
Specified by:
getPosition in interface NodeIterator

setPosition

public boolean setPosition(int position)
Description copied from interface: NodeIterator
Sets the new current position and returns true if there a node at that position.

Specified by:
setPosition in interface NodeIterator

getNodePointer

public NodePointer getNodePointer()
Specified by:
getNodePointer in interface NodeIterator

prepare

private void prepare()