Package com.google.common.base
Class CharMatcher.ForPredicate
- java.lang.Object
-
- com.google.common.base.CharMatcher
-
- com.google.common.base.CharMatcher.ForPredicate
-
- All Implemented Interfaces:
Predicate<java.lang.Character>,java.util.function.Predicate<java.lang.Character>
- Enclosing class:
- CharMatcher
private static final class CharMatcher.ForPredicate extends CharMatcher
Implementation ofCharMatcher.forPredicate(Predicate).
-
-
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 ForPredicate(Predicate<? super java.lang.Character> predicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapply(java.lang.Character character)Returns the result of applying this predicate toinput(Java 8 users, see notes in the class documentation above).booleanmatches(char c)Determines a true or false value for the given character.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, ascii, breakingWhitespace, collapseFrom, countIn, digit, forPredicate, indexIn, indexIn, inRange, invisible, is, isNot, javaDigit, javaIsoControl, javaLetter, javaLetterOrDigit, javaLowerCase, javaUpperCase, lastIndexIn, matchesAllOf, matchesAnyOf, matchesNoneOf, negate, none, noneOf, or, precomputed, precomputedInternal, removeFrom, replaceFrom, replaceFrom, retainFrom, setBits, singleWidth, trimAndCollapseFrom, trimFrom, trimLeadingFrom, trimTrailingFrom, whitespace
-
-
-
-
Field Detail
-
predicate
private final Predicate<? super java.lang.Character> predicate
-
-
Constructor Detail
-
ForPredicate
ForPredicate(Predicate<? super java.lang.Character> predicate)
-
-
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
-
apply
public boolean apply(java.lang.Character character)
Description copied from interface:PredicateReturns the result of applying this predicate toinput(Java 8 users, see notes in the class documentation above). This method is generally expected, but not absolutely required, to have the following properties:- Its execution does not cause any observable side effects.
- The computation is consistent with equals; that is,
Objects.equal(a, b)implies thatpredicate.apply(a) == predicate.apply(b)).
- Specified by:
applyin interfacePredicate<java.lang.Character>- Overrides:
applyin 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
-
-