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, whitespace
final CharMatcher original
Negated(CharMatcher original)
public boolean matches(char c)
CharMatcher
matches
in class CharMatcher
public boolean matchesAllOf(java.lang.CharSequence sequence)
CharMatcher
true
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 CharMatcher
sequence
- 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)
CharMatcher
true
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 CharMatcher
sequence
- 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)
CharMatcher
countIn
in class CharMatcher
@GwtIncompatible void setBits(java.util.BitSet table)
CharMatcher
table
matched by this matcher.setBits
in class CharMatcher
public CharMatcher negate()
CharMatcher
negate
in class CharMatcher
public java.lang.String toString()
CharMatcher
CharMatcher
, such as
CharMatcher.or(WHITESPACE, JAVA_DIGIT)
.toString
in class CharMatcher