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, trimTrailingFrom
final CharMatcher original
NegatedMatcher(java.lang.String toString, CharMatcher original)
NegatedMatcher(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 false
or the end is reached.
matchesNoneOf
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 int countIn(java.lang.CharSequence sequence)
CharMatcher
countIn
in class CharMatcher
@GwtIncompatible(value="java.util.BitSet") void setBits(java.util.BitSet table)
CharMatcher
table
matched by this matcher.setBits
in class CharMatcher
public CharMatcher negate()
CharMatcher
negate
in class CharMatcher
CharMatcher withToString(java.lang.String description)
CharMatcher
this
,
but with their toString
method overridden with the new description.
This is unsupported by default.
withToString
in class CharMatcher