Package net.sf.saxon.regex
Class ATokenIterator40
java.lang.Object
net.sf.saxon.regex.ATokenIterator40
- All Implemented Interfaces:
Closeable,AutoCloseable,SequenceIterator,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 Summary
ConstructorsConstructorDescriptionATokenIterator40(UnicodeString str, REMatcher matcher) Construct a RegexIterator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether the current item is a matching item or a non-matching itemnext()Get the next item in the sequenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.om.SequenceIterator
close
-
Constructor Details
-
ATokenIterator40
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 analysedmatcher- a matcher for the regular expression
-
-
Method Details
-
next
Get the next item in the sequence- Specified by:
nextin interfaceAtomicIterator- Specified by:
nextin interfaceSequenceIterator- 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
-