## net.sf.saxon.expr
Class FilterIterator.Leading

    java.lang.Object
      |
      +--net.sf.saxon.expr.FilterIterator
            |
            +--net.sf.saxon.expr.FilterIterator.Leading

All Implemented Interfaces:
  SequenceIterator

Enclosing class:
  FilterIterator

public static final class FilterIterator.Leading
extends FilterIterator

Subclass to support the extension function saxon:leading, which terminates the iteration at the first item whose predicate is false

Nested Class Summary

Nested classes inherited from class net.sf.saxon.expr.FilterIterator
`FilterIterator.Leading, FilterIterator.NonNumeric`

Field Summary

Fields inherited from class net.sf.saxon.expr.FilterIterator
`base, filter, filterContext`

Constructor Summary
`FilterIterator.Leading(SequenceIterator base, Expression filter, XPathContext context)`

Method Summary
`SequenceIterator` `getAnother()` Get another iterator to return the same nodes
`protected Item` `getNextMatchingItem()` Get the next node that matches the filter predicate if there is one
`protected boolean` `matches()` Determine whether the context item matches the filter predicate

Methods inherited from class net.sf.saxon.expr.FilterIterator
`current, next, position`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FilterIterator.Leading

    public FilterIterator.Leading(SequenceIterator base,
                                  Expression filter,
                                  XPathContext context)
                           throws XPathException

Method Detail

### matches

    protected boolean matches()
                       throws XPathException

  Determine whether the context item matches the filter predicate

  Overrides:
    `matches` in class `FilterIterator`
    `XPathException`

### getNextMatchingItem

    protected Item getNextMatchingItem()
                                throws XPathException

  Get the next node that matches the filter predicate if there is one

  Overrides:
    `getNextMatchingItem` in class `FilterIterator`
    `XPathException`

### getAnother

    public SequenceIterator getAnother()
                                throws XPathException

  Get another iterator to return the same nodes

  Specified by:
    `getAnother` in interface `SequenceIterator`
  Overrides:
    `getAnother` in class `FilterIterator`
  Returns:
    a SequenceIterator that iterates over the same items, positioned before the first item
  Throws:
    `XPathException` - if any error occurs