Package com.google.common.base
Class CharMatcher.FastMatcher
- java.lang.Object
-
- com.google.common.base.CharMatcher
-
- com.google.common.base.CharMatcher.FastMatcher
-
- All Implemented Interfaces:
Predicate<java.lang.Character>,java.util.function.Predicate<java.lang.Character>
- Direct Known Subclasses:
CharMatcher.InRange,CharMatcher.Is,CharMatcher.IsEither,CharMatcher.IsNot,CharMatcher.NamedFastMatcher
- Enclosing class:
- CharMatcher
abstract static class CharMatcher.FastMatcher extends CharMatcher
A matcher for which precomputation will not yield any significant benefit.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.base.CharMatcher
CharMatcher.FastMatcher, CharMatcher.NamedFastMatcher, CharMatcher.NegatedFastMatcher, CharMatcher.Whitespace
-
-
Constructor Summary
Constructors Constructor Description FastMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharMatchernegate()Returns a matcher that matches any character not matched by this matcher.CharMatcherprecomputed()Returns acharmatcher functionally equivalent to this one, but which may be faster to query than the original; your mileage may vary.-
Methods inherited from class com.google.common.base.CharMatcher
and, any, anyOf, apply, ascii, breakingWhitespace, collapseFrom, countIn, digit, forPredicate, indexIn, indexIn, inRange, invisible, is, isNot, javaDigit, javaIsoControl, javaLetter, javaLetterOrDigit, javaLowerCase, javaUpperCase, lastIndexIn, matches, matchesAllOf, matchesAnyOf, matchesNoneOf, none, noneOf, or, precomputedInternal, removeFrom, replaceFrom, replaceFrom, retainFrom, setBits, singleWidth, toString, trimAndCollapseFrom, trimFrom, trimLeadingFrom, trimTrailingFrom, whitespace
-
-
-
-
Method Detail
-
precomputed
public final CharMatcher precomputed()
Description copied from class:CharMatcherReturns acharmatcher functionally equivalent to this one, but which may be faster to query than the original; your mileage may vary. Precomputation takes time and is likely to be worthwhile only if the precomputed matcher is queried many thousands of times.This method has no effect (returns
this) when called in GWT: it's unclear whether a precomputed matcher is faster, but it certainly consumes more memory, which doesn't seem like a worthwhile tradeoff in a browser.- Overrides:
precomputedin 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
-
-