Package com.google.common.base
Class CharMatcher.Negated
java.lang.Object
com.google.common.base.CharMatcher
com.google.common.base.CharMatcher.Negated
- Direct Known Subclasses:
CharMatcher.NegatedFastMatcher
- Enclosing class:
CharMatcher
Implementation of
negate()
.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.base.CharMatcher
CharMatcher.FastMatcher, CharMatcher.NamedFastMatcher, CharMatcher.Whitespace
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
countIn
(CharSequence sequence) Returns the number of matchingchar
s found in a character sequence.boolean
matches
(char c) Determines a true or false value for the given character.boolean
matchesAllOf
(CharSequence sequence) Returnstrue
if a character sequence contains only matching BMP characters.boolean
matchesNoneOf
(CharSequence sequence) Returnstrue
if a character sequence contains no matching BMP characters.negate()
Returns a matcher that matches any character not matched by this matcher.(package private) void
Sets bits intable
matched by this matcher.toString()
Returns a string representation of thisCharMatcher
, such asCharMatcher.or(WHITESPACE, JAVA_DIGIT)
.Methods inherited from class com.google.common.base.CharMatcher
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
-
Field Details
-
original
-
-
Constructor Details
-
Negated
Negated(CharMatcher original)
-
-
Method Details
-
matches
public boolean matches(char c) Description copied from class:CharMatcher
Determines a true or false value for the given character.- Specified by:
matches
in classCharMatcher
-
matchesAllOf
Description copied from class:CharMatcher
Returnstrue
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 returnsfalse
or the end is reached.- Overrides:
matchesAllOf
in classCharMatcher
- Parameters:
sequence
- the character sequence to examine, possibly empty- Returns:
true
if this matcher matches every character in the sequence, including when the sequence is empty
-
matchesNoneOf
Description copied from class:CharMatcher
Returnstrue
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 returnstrue
or the end is reached.- Overrides:
matchesNoneOf
in classCharMatcher
- Parameters:
sequence
- the character sequence to examine, possibly empty- Returns:
true
if this matcher matches no characters in the sequence, including when the sequence is empty
-
countIn
Description copied from class:CharMatcher
Returns the number of matchingchar
s found in a character sequence.Counts 2 per supplementary character, such as for
CharMatcher.whitespace()
().CharMatcher.negate()
().- Overrides:
countIn
in classCharMatcher
-
setBits
Description copied from class:CharMatcher
Sets bits intable
matched by this matcher.- Overrides:
setBits
in classCharMatcher
-
negate
Description copied from class:CharMatcher
Returns a matcher that matches any character not matched by this matcher.- Specified by:
negate
in interfacePredicate<Character>
- Overrides:
negate
in classCharMatcher
-
toString
Description copied from class:CharMatcher
Returns a string representation of thisCharMatcher
, such asCharMatcher.or(WHITESPACE, JAVA_DIGIT)
.- Overrides:
toString
in classCharMatcher
-