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
char s 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, 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 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 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 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 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
char
s found in a character sequence.
Counts 2 per supplementary character, such as for CharMatcher.whitespace()
().CharMatcher.negate()
().
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 interface java.util.function.Predicate<java.lang.Character>
negate
in class CharMatcher
public java.lang.String toString()
CharMatcher
CharMatcher
, such as CharMatcher.or(WHITESPACE, JAVA_DIGIT)
.toString
in class CharMatcher