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 TypeMethodDescriptionintcountIn(CharSequence sequence) Returns the number of matchingchars found in a character sequence.booleanmatches(char c) Determines a true or false value for the given character.booleanmatchesAllOf(CharSequence sequence) Returnstrueif a character sequence contains only matching BMP characters.booleanmatchesNoneOf(CharSequence sequence) Returnstrueif a character sequence contains no matching BMP characters.negate()Returns a matcher that matches any character not matched by this matcher.(package private) voidSets bits intablematched 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:CharMatcherDetermines a true or false value for the given character.- Specified by:
matchesin classCharMatcher
-
matchesAllOf
Description copied from class:CharMatcherReturnstrueif a character sequence contains only matching BMP characters.The default implementation iterates over the sequence, invoking
CharMatcher.matches(char)for each character, until this returnsfalseor the end is reached.- Overrides:
matchesAllOfin classCharMatcher- Parameters:
sequence- the character sequence to examine, possibly empty- Returns:
trueif this matcher matches every character in the sequence, including when the sequence is empty
-
matchesNoneOf
Description copied from class:CharMatcherReturnstrueif 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 returnstrueor the end is reached.- Overrides:
matchesNoneOfin classCharMatcher- Parameters:
sequence- the character sequence to examine, possibly empty- Returns:
trueif this matcher matches no characters in the sequence, including when the sequence is empty
-
countIn
Description copied from class:CharMatcherReturns the number of matchingchars found in a character sequence.Counts 2 per supplementary character, such as for
CharMatcher.whitespace()().CharMatcher.negate()().- Overrides:
countInin classCharMatcher
-
setBits
Description copied from class:CharMatcherSets bits intablematched by this matcher.- Overrides:
setBitsin classCharMatcher
-
negate
Description copied from class:CharMatcherReturns a matcher that matches any character not matched by this matcher.- Specified by:
negatein interfacePredicate<Character>- Overrides:
negatein classCharMatcher
-
toString
Description copied from class:CharMatcherReturns a string representation of thisCharMatcher, such asCharMatcher.or(WHITESPACE, JAVA_DIGIT).- Overrides:
toStringin classCharMatcher
-