org.apache.xalan.xsltc.dom
Class DupFilterIterator

java.lang.Object
  |
  +--org.apache.xalan.xsltc.dom.NodeIteratorBase
        |
        +--org.apache.xalan.xsltc.dom.DupFilterIterator

public final class DupFilterIterator
extends NodeIteratorBase


Constructor Summary
DupFilterIterator(NodeIterator source)
          Creates a new duplicate filter iterator based on an existing iterator.
 
Method Summary
 int getLast()
          Returns the position of the last node in this iterator.
 int getPosition()
          Returns the current position of the iterator.
 void gotoMark()
          Restores the position of this iterator - see setMark()
 int next()
          Returns the next node in this iterator - excludes duplicates.
 NodeIterator reset()
           
 void setMark()
          Saves the position of this iterator - see gotoMark()
 NodeIterator setStartNode(int node)
          Set the start node for this iterator
 
Methods inherited from class org.apache.xalan.xsltc.dom.NodeIteratorBase
cloneIterator, includeSelf, isReverse, setRestartable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DupFilterIterator

public DupFilterIterator(NodeIterator source)
Creates a new duplicate filter iterator based on an existing iterator. This iterator should be used with union expressions and other complex iterator combinations (like 'get me the parents of all child node in the dom' sort of thing). The iterator is also used to cache node-sets returned by id() and key() iterators.
Parameters:
source - The iterator this iterator will get its nodes from
Method Detail

next

public int next()
Returns the next node in this iterator - excludes duplicates.
Returns:
The next node in this iterator

setStartNode

public NodeIterator setStartNode(int node)
Set the start node for this iterator
Parameters:
node - The start node
Returns:
A reference to this node iterator

getPosition

public int getPosition()
Returns the current position of the iterator. The position is within the node set covered by this iterator, not within the DOM.
Overrides:
getPosition in class NodeIteratorBase

getLast

public int getLast()
Returns the position of the last node in this iterator. The integer returned is equivalent to the number of nodes in this iterator.
Overrides:
getLast in class NodeIteratorBase

setMark

public void setMark()
Saves the position of this iterator - see gotoMark()

gotoMark

public void gotoMark()
Restores the position of this iterator - see setMark()

reset

public NodeIterator reset()
Overrides:
reset in class NodeIteratorBase


Copyright © 2001 Apache XML Project. All Rights Reserved.