Package com.google.common.base
Class CharMatcher.Negated
- java.lang.Object
-
- com.google.common.base.CharMatcher
-
- com.google.common.base.CharMatcher.Negated
-
- All Implemented Interfaces:
Predicate<java.lang.Character>,java.util.function.Predicate<java.lang.Character>
- Direct Known Subclasses:
CharMatcher.NegatedFastMatcher
- Enclosing class:
- CharMatcher
private static class CharMatcher.Negated extends CharMatcher
Implementation ofnegate().
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.base.CharMatcher
CharMatcher.FastMatcher, CharMatcher.NamedFastMatcher, CharMatcher.NegatedFastMatcher, CharMatcher.Whitespace
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CharMatcheroriginal
-
Constructor Summary
Constructors Constructor Description Negated(CharMatcher original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountIn(java.lang.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(java.lang.CharSequence sequence)Returnstrueif a character sequence contains only matching BMP characters.booleanmatchesNoneOf(java.lang.CharSequence sequence)Returnstrueif a character sequence contains no matching BMP characters.CharMatchernegate()Returns a matcher that matches any character not matched by this matcher.(package private) voidsetBits(java.util.BitSet table)Sets bits intablematched by this matcher.java.lang.StringtoString()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 Detail
-
original
final CharMatcher original
-
-
Constructor Detail
-
Negated
Negated(CharMatcher original)
-
-
Method Detail
-
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
public boolean matchesAllOf(java.lang.CharSequence sequence)
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
public boolean matchesNoneOf(java.lang.CharSequence sequence)
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
public int countIn(java.lang.CharSequence sequence)
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
@GwtIncompatible void setBits(java.util.BitSet table)
Description copied from class:CharMatcherSets bits intablematched by this matcher.- Overrides:
setBitsin classCharMatcher
-
negate
public CharMatcher negate()
Description copied from class:CharMatcherReturns a matcher that matches any character not matched by this matcher.- Specified by:
negatein interfacejava.util.function.Predicate<java.lang.Character>- Overrides:
negatein classCharMatcher
-
toString
public java.lang.String toString()
Description copied from class:CharMatcherReturns a string representation of thisCharMatcher, such asCharMatcher.or(WHITESPACE, JAVA_DIGIT).- Overrides:
toStringin classCharMatcher
-
-