Class FilterIterator

  • All Implemented Interfaces:
    java.lang.Cloneable, DTMAxisIterator

    public final class FilterIterator
    extends DTMAxisIteratorBase
    Similar to a CurrentNodeListIterator except that the filter has a simpler interface (only needs the node, no position, last, etc.) It takes a source iterator and a Filter object and returns nodes from the source after filtering them by calling filter.test(node).
    Author:
    Jacek Ambroziak, Santiago Pericas-Geertsen
    • Method Detail

      • next

        public int next()
        Description copied from interface: DTMAxisIterator
        Get the next node in the iteration.
        Returns:
        The next node handle in the iteration, or END.
      • setStartNode

        public DTMAxisIterator setStartNode​(int node)
        Description copied from interface: DTMAxisIterator
        Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
        Parameters:
        node - Sets the root of the iteration.
        Returns:
        A DTMAxisIterator set to the start of the iteration.
      • setMark

        public void setMark()
        Description copied from interface: DTMAxisIterator
        Remembers the current node for the next call to gotoMark().
      • gotoMark

        public void gotoMark()
        Description copied from interface: DTMAxisIterator
        Restores the current node remembered by setMark().