Interface LookaheadMatcher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Look-ahead matcher callback for Parser.skipPeek(LookaheadMatcher).
This is a functional interface for method references or lambdas.
It contains one method toSkip(int, int) that determines
whether to abort or continue skipping, based on the characters in
the input data.
This interface is identical to BiFunction<int, int, boolean>
except for the name of its functional method.
- Author:
- mirabilos (t.glaser@tarent.de)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleantoSkip(int cur, int next) Determines whether the current character is to be skipped.
-
Method Details
-
toSkip
boolean toSkip(int cur, int next) Determines whether the current character is to be skipped.
Skipping ahead is determined based on the codepoints in the file, that is, the input fully decoded to UCS (ISO 10646) codepoints, not just bytes or Java™-internal UTF-16 characters. If the end of input is reached,
-1will be passed; otherwise, the 21-bit UCS codepoint of the respective wide (possibly multibyte, in the input) character.- Parameters:
cur- the codepoint of the current characternext- the codepoint of the character past the current one- Returns:
trueto continue skipping ahead,falseto stop skipping
-