private static class CharMatcher.NegatedMatcher extends CharMatcher
CharMatcher.FastMatcher, CharMatcher.NegatedFastMatcher| Modifier and Type | Field and Description |
|---|---|
(package private) CharMatcher |
original |
ANY, ASCII, BREAKING_WHITESPACE, description, DIGIT, INVISIBLE, JAVA_DIGIT, JAVA_ISO_CONTROL, JAVA_LETTER, JAVA_LETTER_OR_DIGIT, JAVA_LOWER_CASE, JAVA_UPPER_CASE, NONE, SINGLE_WIDTH, WHITESPACE, WHITESPACE_MULTIPLIER, WHITESPACE_SHIFT, WHITESPACE_TABLE| Constructor and Description |
|---|
NegatedMatcher(CharMatcher original) |
NegatedMatcher(java.lang.String toString,
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. |
(package private) CharMatcher |
withToString(java.lang.String description)
Subclasses should provide a new CharMatcher with the same characteristics as
this,
but with their toString method overridden with the new description. |
and, anyOf, apply, collapseFrom, forPredicate, indexIn, indexIn, inRange, inRange, is, isNot, lastIndexIn, matchesAnyOf, noneOf, or, precomputed, precomputedInternal, removeFrom, replaceFrom, replaceFrom, retainFrom, toString, trimAndCollapseFrom, trimFrom, trimLeadingFrom, trimTrailingFromfinal CharMatcher original
NegatedMatcher(java.lang.String toString,
CharMatcher original)
NegatedMatcher(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 false or the end is reached.
matchesNoneOf 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 int countIn(java.lang.CharSequence sequence)
CharMatchercountIn in class CharMatcher@GwtIncompatible(value="java.util.BitSet") void setBits(java.util.BitSet table)
CharMatchertable matched by this matcher.setBits in class CharMatcherpublic CharMatcher negate()
CharMatchernegate in class CharMatcherCharMatcher withToString(java.lang.String description)
CharMatcherthis,
but with their toString method overridden with the new description.
This is unsupported by default.
withToString in class CharMatcher