Package com.google.mu.util
Interface CharPredicate
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A predicate of character. More efficient than
Predicate<Character>
.- Since:
- 6.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CharPredicate
Equivalent to the[a-zA-Z]
character class.static final CharPredicate
Corresponds to all characters.static final CharPredicate
Corresponds to the ASCII characters.static final CharPredicate
Corresponds to no characters.static final CharPredicate
Equivalent to the[a-zA-Z0-9_]
character class. -
Method Summary
Modifier and TypeMethodDescriptiondefault CharPredicate
and
(CharPredicate that) Returns aCharPredicate
that evaluates true if both this andthat
predicate evaluate to true.static CharPredicate
Returns a CharPredicate that matches any ofchars
.static CharPredicate
is
(char ch) Returns a CharPredicate for the range of characters:[from, to]
.default boolean
matchesAllOf
(CharSequence sequence) Returnstrue
if a character sequence contains only matching BMP characters.default boolean
matchesAnyOf
(CharSequence sequence) Returnstrue
if a character sequence contains at least one matching BMP character.default boolean
matchesNoneOf
(CharSequence sequence) Returnstrue
if a character sequence contains no matching BMP characters.static CharPredicate
Returns a CharPredicate that matches any ofchars
.default CharPredicate
not()
Returns the negation of thisCharPredicate
.default CharPredicate
or
(char ch) Returns aCharPredicate
that evaluates true if either this predicate evaluates to true, or the character isch
.default CharPredicate
or
(CharPredicate that) Returns aCharPredicate
that evaluates true if either this orthat
predicate evaluate to true.default CharPredicate
orRange
(char from, char to) Returns aCharPredicate
that evaluates true if either this predicate evaluates to true, or the character is in the range of[from, to]
.static CharPredicate
range
(char from, char to) Returns a CharPredicate for the range of characters:[from, to]
.boolean
test
(char ch) Returns true ifch
satisfies this predicate.
-
Field Details
-
ALPHA
Equivalent to the[a-zA-Z]
character class. -
WORD
Equivalent to the[a-zA-Z0-9_]
character class. -
ASCII
Corresponds to the ASCII characters. -
ANY
Corresponds to all characters. -
NONE
Corresponds to no characters.
-
-
Method Details
-
is
Returns a CharPredicate for the range of characters:[from, to]
. -
range
Returns a CharPredicate for the range of characters:[from, to]
. -
anyOf
Returns a CharPredicate that matches any ofchars
. -
noneOf
Returns a CharPredicate that matches any ofchars
. -
test
boolean test(char ch) Returns true ifch
satisfies this predicate. -
or
Returns aCharPredicate
that evaluates true if either this orthat
predicate evaluate to true. -
and
Returns aCharPredicate
that evaluates true if both this andthat
predicate evaluate to true. -
or
Returns aCharPredicate
that evaluates true if either this predicate evaluates to true, or the character isch
. -
orRange
Returns aCharPredicate
that evaluates true if either this predicate evaluates to true, or the character is in the range of[from, to]
. -
not
Returns the negation of thisCharPredicate
. -
matchesAnyOf
Returnstrue
if a character sequence contains at least one matching BMP character. Equivalent to!matchesNoneOf(sequence)
.- Since:
- 7.0
-
matchesAllOf
Returnstrue
if a character sequence contains only matching BMP characters.- Since:
- 7.0
-
matchesNoneOf
Returnstrue
if a character sequence contains no matching BMP characters. Equivalent to!matchesAnyOf(sequence)
.- Since:
- 7.0
-