Interface UnfailingIterator

All Superinterfaces:
AutoCloseable, Closeable, SequenceIterator
All Known Subinterfaces:
AtomicIterator<T>, AxisIterator, ConstrainedIterator<T>
All Known Implementing Classes:
AncestorEnumeration, AncestorIterator, ArrayIterator, ArrayIterator.OfNodes, ATokenIterator, AttributeAxisIterator, AttributeIterator, BigRangeIterator, ChildEnumeration, ConcatenatingAxisIterator, DescendantIterator, DescendantIteratorSansText, EmptyIterator, FollowingEnumeration, FollowingIterator, FollowingSiblingEnumeration, JTokenIterator, ListIterator, ListIterator.Atomic, ListIterator.OfNodes, ManualIterator, NamedChildIterator, Navigator.AncestorEnumeration, Navigator.AxisFilter, Navigator.DescendantEnumeration, Navigator.EmptyTextFilter, Navigator.FollowingEnumeration, Navigator.PrecedingEnumeration, NodeWrappingAxisIterator, PrecedingEnumeration, PrecedingIterator, PrecedingOrAncestorEnumeration, PrecedingSiblingEnumeration, PrecedingSiblingIterator, PrependAxisIterator, RangeIterator, ReverseListIterator, ReverseRangeIterator, SiblingIterator, SingleAtomicIterator, SingleNodeIterator, SingletonIterator, SteppingNavigator.DescendantAxisIterator, StringValue.CharacterIterator, StringValue.UnicodeCharacterIterator, TreeEnumeration, VirtualCopy.VirtualCopier, Whitespace.Tokenizer, WrappingIterator

public interface UnfailingIterator extends SequenceIterator
A SequenceIterator is used to iterate over a sequence. An UnfailingIterator is a SequenceIterator that throws no checked exceptions.
  • Method Details

    • next

      Item next()
      Get the next item in the sequence.
      Specified by:
      next in interface SequenceIterator
      Returns:
      the next Item. If there are no more items, return null.
    • forEach

      default void forEach(Consumer<? super Item> consumer)
      Process all the items returned by the iterator, supplying them to a given Consumer. Note that this method throws no exceptions. This method consumes the iterator.
      Parameters:
      consumer - the function that is to consume each of the (remaining) items returned by the iterator
    • toList

      default List<Item> toList()
      Create a list containing all the items returned by the iterator. This method consumes the iterator.
      Returns:
      a list containing all the (remaining) items returned by the iterator