Class ATokenIterator40

java.lang.Object
net.sf.saxon.regex.ATokenIterator40
All Implemented Interfaces:
Closeable, AutoCloseable, SequenceIterator, AtomicIterator

public class ATokenIterator40 extends Object implements AtomicIterator
A ATokenIterator is an iterator over the strings that result from tokenizing a string using a regular expression This is a rewrite for 4.0 (which allows a regex to match a zero-length string; it is based on the implementation of fn:analyze string and could be considerably simplified.
  • Constructor Details

    • ATokenIterator40

      public ATokenIterator40(UnicodeString str, REMatcher matcher)
      Construct a RegexIterator. Note that the underlying matcher.find() method is called once to obtain each matching substring. But the iterator also returns non-matching substrings if these appear between the matching substrings.
      Parameters:
      str - the string to be analysed
      matcher - a matcher for the regular expression
  • Method Details

    • next

      public StringValue next()
      Get the next item in the sequence
      Specified by:
      next in interface AtomicIterator
      Specified by:
      next in interface SequenceIterator
      Returns:
      the next item in the sequence
    • isMatching

      public boolean isMatching()
      Determine whether the current item is a matching item or a non-matching item
      Returns:
      true if the current item (the one most recently returned by next()) is an item that matches the regular expression, or false if it is an item that does not match