private static class CharMatcher.Negated extends CharMatcher
negate().CharMatcher.FastMatcher, CharMatcher.NamedFastMatcher, CharMatcher.NegatedFastMatcher, CharMatcher.Whitespace| Modifier and Type | Field and Description |
|---|---|
(package private) CharMatcher |
original |
| Constructor and Description |
|---|
Negated(CharMatcher original) |
| Modifier and Type | Method and Description |
|---|---|
int |
countIn(java.lang.CharSequence sequence)
Returns the number of matching
chars found in a character sequence. |
boolean |
matches(char c)
Determines a true or false value for the given character.
|
boolean |
matchesAllOf(java.lang.CharSequence sequence)
Returns
true if a character sequence contains only matching BMP characters. |
boolean |
matchesNoneOf(java.lang.CharSequence sequence)
Returns
true if a character sequence contains no matching BMP characters. |
CharMatcher |
negate()
Returns a matcher that matches any character not matched by this matcher.
|
(package private) void |
setBits(java.util.BitSet table)
Sets bits in
table matched by this matcher. |
java.lang.String |
toString()
Returns a string representation of this
CharMatcher, such as CharMatcher.or(WHITESPACE, JAVA_DIGIT). |
and, any, anyOf, apply, ascii, breakingWhitespace, collapseFrom, digit, forPredicate, indexIn, indexIn, inRange, invisible, is, isNot, javaDigit, javaIsoControl, javaLetter, javaLetterOrDigit, javaLowerCase, javaUpperCase, lastIndexIn, matchesAnyOf, none, noneOf, or, precomputed, precomputedInternal, removeFrom, replaceFrom, replaceFrom, retainFrom, singleWidth, trimAndCollapseFrom, trimFrom, trimLeadingFrom, trimTrailingFrom, whitespacefinal CharMatcher original
Negated(CharMatcher original)
public boolean matches(char c)
CharMatchermatches in class CharMatcherpublic boolean matchesAllOf(java.lang.CharSequence sequence)
CharMatchertrue if a character sequence contains only matching BMP characters.
The default implementation iterates over the sequence, invoking CharMatcher.matches(char) for each
character, until this returns false or the end is reached.
matchesAllOf in class CharMatchersequence - the character sequence to examine, possibly emptytrue if this matcher matches every character in the sequence, including when
the sequence is emptypublic boolean matchesNoneOf(java.lang.CharSequence sequence)
CharMatchertrue if a character sequence contains no matching BMP characters. Equivalent to
!matchesAnyOf(sequence).
The default implementation iterates over the sequence, invoking CharMatcher.matches(char) for each
character, until this returns true or the end is reached.
matchesNoneOf in class CharMatchersequence - the character sequence to examine, possibly emptytrue if this matcher matches no characters in the sequence, including when the
sequence is emptypublic int countIn(java.lang.CharSequence sequence)
CharMatcherchars found in a character sequence.
Counts 2 per supplementary character, such as for CharMatcher.whitespace()().CharMatcher.negate()().
countIn in class CharMatchervoid setBits(java.util.BitSet table)
CharMatchertable matched by this matcher.setBits in class CharMatcherpublic CharMatcher negate()
CharMatchernegate in interface java.util.function.Predicate<java.lang.Character>negate in class CharMatcherpublic java.lang.String toString()
CharMatcherCharMatcher, such as CharMatcher.or(WHITESPACE, JAVA_DIGIT).toString in class CharMatcher