Class ReverseListIterator

java.lang.Object
com.puppycrawl.tools.checkstyle.xpath.iterators.ReverseListIterator
All Implemented Interfaces:
Closeable, AutoCloseable, net.sf.saxon.om.SequenceIterator, net.sf.saxon.tree.iter.AxisIterator, net.sf.saxon.tree.iter.UnfailingIterator

public class ReverseListIterator extends Object implements net.sf.saxon.tree.iter.AxisIterator
Iterates list in backward direction.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.sf.saxon.om.SequenceIterator

    net.sf.saxon.om.SequenceIterator.Property
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Current index.
    private final List<AbstractNode>
    List of nodes.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for ReverseListIterator class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.sf.saxon.om.NodeInfo
    Get the next item in the sequence.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.sf.saxon.tree.iter.AxisIterator

    asIterator, forEachNode

    Methods inherited from interface net.sf.saxon.om.SequenceIterator

    close, forEachOrFail, getProperties, materialize

    Methods inherited from interface net.sf.saxon.tree.iter.UnfailingIterator

    forEach, toList
  • Field Details

    • items

      private final List<AbstractNode> items
      List of nodes.
    • index

      private int index
      Current index.
  • Constructor Details

    • ReverseListIterator

      public ReverseListIterator(List<AbstractNode> items)
      Constructor for ReverseListIterator class.
      Parameters:
      items - the list of nodes.
  • Method Details

    • next

      public net.sf.saxon.om.NodeInfo next()
      Get the next item in the sequence.
      Specified by:
      next in interface net.sf.saxon.tree.iter.AxisIterator
      Specified by:
      next in interface net.sf.saxon.om.SequenceIterator
      Specified by:
      next in interface net.sf.saxon.tree.iter.UnfailingIterator
      Returns:
      the next Item. If there are no more nodes, return null.