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 |
ANY, ASCII, BREAKING_WHITESPACE, DIGIT, INVISIBLE, JAVA_DIGIT, JAVA_ISO_CONTROL, JAVA_LETTER, JAVA_LETTER_OR_DIGIT, JAVA_LOWER_CASE, JAVA_UPPER_CASE, NONE, SINGLE_WIDTH, WHITESPACE| Constructor and Description |
|---|
Negated(CharMatcher original) |
| Modifier and Type | Method and Description |
|---|---|
int |
countIn(java.lang.CharSequence sequence)
Returns the number of matching characters 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 characters. |
boolean |
matchesNoneOf(java.lang.CharSequence sequence)
Returns
true if a character sequence contains no matching 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 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 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)
CharMatchercountIn in class CharMatcher@GwtIncompatible void setBits(java.util.BitSet table)
CharMatchertable matched by this matcher.setBits in class CharMatcherpublic CharMatcher negate()
CharMatchernegate in class CharMatcherpublic java.lang.String toString()
CharMatcherCharMatcher, such as
CharMatcher.or(WHITESPACE, JAVA_DIGIT).toString in class CharMatcher