Package org.jparsec.pattern
Class CharPredicates
- java.lang.Object
-
- org.jparsec.pattern.CharPredicates
-
public final class CharPredicates extends java.lang.Object
Provides commonCharPredicate
implementations.
-
-
Field Summary
Fields Modifier and Type Field Description static CharPredicate
ALWAYS
ACharPredicate
that always returns true.static CharPredicate
IS_ALPHA
ACharPredicate
that returns true if the character is an alpha character.static CharPredicate
IS_ALPHA_
ACharPredicate
that returns true if it is an alpha character or the underscore character_
.static CharPredicate
IS_ALPHA_NUMERIC
ACharPredicate
that returns true if it is an alphanumeric character, or an underscore character.static CharPredicate
IS_ALPHA_NUMERIC_
ACharPredicate
that returns true if it is an alphanumeric character, or an underscore character.static CharPredicate
IS_DIGIT
ACharPredicate
that returns true if the character is a digit.static CharPredicate
IS_HEX_DIGIT
ACharPredicate
that returns true if the character is a digit or within the range of[a-f]
or[A-F]
.static CharPredicate
IS_LETTER
ACharPredicate
that returns true ifCharacter.isLetter(char)
returns true.static CharPredicate
IS_LOWER_CASE
ACharPredicate
that returns true ifCharacter.isLowerCase(char)
returns true.static CharPredicate
IS_UPPER_CASE
ACharPredicate
that returns true ifCharacter.isUpperCase(char)
returns true.static CharPredicate
IS_WHITESPACE
ACharPredicate
that returns true ifCharacter.isWhitespace(char)
returns true.static CharPredicate
NEVER
ACharPredicate
that always returns false.
-
Constructor Summary
Constructors Modifier Constructor Description private
CharPredicates()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CharPredicate
among(java.lang.String chars)
ACharPredicate
that returns true if the character is equal to any character inchars
.static CharPredicate
and(CharPredicate... predicates)
static CharPredicate
and(CharPredicate predicate1, CharPredicate predicate2)
static CharPredicate
isChar(char c)
ACharPredicate
that returns true if the character is equal toc
.static CharPredicate
not(CharPredicate predicate)
ACharPredicate
that returns true ifpredicate
evaluates to false.static CharPredicate
notAmong(java.lang.String chars)
ACharPredicate
that returns true if the character is not equal to any character inchars
.static CharPredicate
notChar(char c)
ACharPredicate
that returns true if the character is not equal toc
.static CharPredicate
notRange(char a, char b)
ACharPredicate
that returns true if the character is not within the range of[a, b]
.static CharPredicate
or(CharPredicate... predicates)
static CharPredicate
or(CharPredicate predicate1, CharPredicate predicate2)
static CharPredicate
range(char a, char b)
ACharPredicate
that returns true if the character is within the range of[a, b]
.
-
-
-
Field Detail
-
NEVER
public static final CharPredicate NEVER
ACharPredicate
that always returns false.
-
ALWAYS
public static final CharPredicate ALWAYS
ACharPredicate
that always returns true.
-
IS_HEX_DIGIT
public static final CharPredicate IS_HEX_DIGIT
ACharPredicate
that returns true if the character is a digit or within the range of[a-f]
or[A-F]
.
-
IS_UPPER_CASE
public static final CharPredicate IS_UPPER_CASE
ACharPredicate
that returns true ifCharacter.isUpperCase(char)
returns true.
-
IS_LOWER_CASE
public static final CharPredicate IS_LOWER_CASE
ACharPredicate
that returns true ifCharacter.isLowerCase(char)
returns true.
-
IS_WHITESPACE
public static final CharPredicate IS_WHITESPACE
ACharPredicate
that returns true ifCharacter.isWhitespace(char)
returns true.
-
IS_ALPHA
public static final CharPredicate IS_ALPHA
ACharPredicate
that returns true if the character is an alpha character.
-
IS_ALPHA_
public static final CharPredicate IS_ALPHA_
ACharPredicate
that returns true if it is an alpha character or the underscore character_
.
-
IS_LETTER
public static final CharPredicate IS_LETTER
ACharPredicate
that returns true ifCharacter.isLetter(char)
returns true.
-
IS_ALPHA_NUMERIC
public static final CharPredicate IS_ALPHA_NUMERIC
ACharPredicate
that returns true if it is an alphanumeric character, or an underscore character.
-
IS_ALPHA_NUMERIC_
public static final CharPredicate IS_ALPHA_NUMERIC_
ACharPredicate
that returns true if it is an alphanumeric character, or an underscore character.
-
IS_DIGIT
public static final CharPredicate IS_DIGIT
ACharPredicate
that returns true if the character is a digit.
-
-
Method Detail
-
isChar
public static CharPredicate isChar(char c)
ACharPredicate
that returns true if the character is equal toc
.
-
notChar
public static CharPredicate notChar(char c)
ACharPredicate
that returns true if the character is not equal toc
.
-
range
public static CharPredicate range(char a, char b)
ACharPredicate
that returns true if the character is within the range of[a, b]
.
-
notRange
public static CharPredicate notRange(char a, char b)
ACharPredicate
that returns true if the character is not within the range of[a, b]
.
-
among
public static CharPredicate among(java.lang.String chars)
ACharPredicate
that returns true if the character is equal to any character inchars
.
-
notAmong
public static CharPredicate notAmong(java.lang.String chars)
ACharPredicate
that returns true if the character is not equal to any character inchars
.
-
not
public static CharPredicate not(CharPredicate predicate)
ACharPredicate
that returns true ifpredicate
evaluates to false.
-
and
public static CharPredicate and(CharPredicate predicate1, CharPredicate predicate2)
-
or
public static CharPredicate or(CharPredicate predicate1, CharPredicate predicate2)
-
and
public static CharPredicate and(CharPredicate... predicates)
-
or
public static CharPredicate or(CharPredicate... predicates)
-
-