org.codehaus.jparsec.pattern
Class CharPredicates

java.lang.Object
  extended by org.codehaus.jparsec.pattern.CharPredicates

public final class CharPredicates
extends Object

Provides common CharPredicate implementations.

Author:
Ben Yu

Field Summary
static CharPredicate ALWAYS
          A CharPredicate that always returns true.
static CharPredicate IS_ALPHA
          A CharPredicate that returns true if the character is an alpha character.
static CharPredicate IS_ALPHA_
          A CharPredicate that returns true if it is an alpha character or the underscore character _.
static CharPredicate IS_ALPHA_NUMERIC
          A CharPredicate that returns true if it is an alphanumeric character, or an underscore character.
static CharPredicate IS_ALPHA_NUMERIC_
          A CharPredicate that returns true if it is an alphanumeric character, or an underscore character.
static CharPredicate IS_DIGIT
          A CharPredicate that returns true if the character is a digit.
static CharPredicate IS_HEX_DIGIT
          A CharPredicate that returns true if the character is a digit or within the range of [a-f] or [A-F].
static CharPredicate IS_LETTER
          A CharPredicate that returns true if Character.isLetter(char) returns true.
static CharPredicate IS_LOWER_CASE
          A CharPredicate that returns true if Character.isLowerCase(char) returns true.
static CharPredicate IS_UPPER_CASE
          A CharPredicate that returns true if Character.isUpperCase(char) returns true.
static CharPredicate IS_WHITESPACE
          A CharPredicate that returns true if Character.isWhitespace(char) returns true.
static CharPredicate NEVER
          A CharPredicate that always returns false.
 
Method Summary
static CharPredicate among(String chars)
          A CharPredicate that returns true if the character is equal to any character in chars.
static CharPredicate and(CharPredicate... predicates)
          A CharPredicate that returns true if all CharPredicate in predicates evaluate to true.
static CharPredicate and(CharPredicate predicate1, CharPredicate predicate2)
          A CharPredicate that returns true if both predicate1 and predicate2 evaluates to true.
static CharPredicate isChar(char c)
          A CharPredicate that returns true if the character is equal to c.
static CharPredicate not(CharPredicate predicate)
          A CharPredicate that returns true if predicate evaluates to false.
static CharPredicate notAmong(String chars)
          A CharPredicate that returns true if the character is not equal to any character in chars.
static CharPredicate notChar(char c)
          A CharPredicate that returns true if the character is not equal to c.
static CharPredicate notRange(char a, char b)
          A CharPredicate that returns true if the character is not within the range of [a, b].
static CharPredicate or(CharPredicate... predicates)
          A CharPredicate that returns true if any CharPredicate in predicates evaluates to true.
static CharPredicate or(CharPredicate predicate1, CharPredicate predicate2)
          A CharPredicate that returns true if either predicate1 or predicate2 evaluates to true.
static CharPredicate range(char a, char b)
          A CharPredicate that returns true if the character is within the range of [a, b].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEVER

public static final CharPredicate NEVER
A CharPredicate that always returns false.


ALWAYS

public static final CharPredicate ALWAYS
A CharPredicate that always returns true.


IS_HEX_DIGIT

public static final CharPredicate IS_HEX_DIGIT
A CharPredicate 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
A CharPredicate that returns true if Character.isUpperCase(char) returns true.


IS_LOWER_CASE

public static final CharPredicate IS_LOWER_CASE
A CharPredicate that returns true if Character.isLowerCase(char) returns true.


IS_WHITESPACE

public static final CharPredicate IS_WHITESPACE
A CharPredicate that returns true if Character.isWhitespace(char) returns true.


IS_ALPHA

public static final CharPredicate IS_ALPHA
A CharPredicate that returns true if the character is an alpha character.


IS_ALPHA_

public static final CharPredicate IS_ALPHA_
A CharPredicate that returns true if it is an alpha character or the underscore character _.


IS_LETTER

public static final CharPredicate IS_LETTER
A CharPredicate that returns true if Character.isLetter(char) returns true.


IS_ALPHA_NUMERIC

public static final CharPredicate IS_ALPHA_NUMERIC
A CharPredicate that returns true if it is an alphanumeric character, or an underscore character.


IS_ALPHA_NUMERIC_

public static final CharPredicate IS_ALPHA_NUMERIC_
A CharPredicate that returns true if it is an alphanumeric character, or an underscore character.


IS_DIGIT

public static final CharPredicate IS_DIGIT
A CharPredicate that returns true if the character is a digit.

Method Detail

isChar

public static CharPredicate isChar(char c)
A CharPredicate that returns true if the character is equal to c.


notChar

public static CharPredicate notChar(char c)
A CharPredicate that returns true if the character is not equal to c.


range

public static CharPredicate range(char a,
                                  char b)
A CharPredicate that returns true if the character is within the range of [a, b].


notRange

public static CharPredicate notRange(char a,
                                     char b)
A CharPredicate that returns true if the character is not within the range of [a, b].


among

public static CharPredicate among(String chars)
A CharPredicate that returns true if the character is equal to any character in chars.


notAmong

public static CharPredicate notAmong(String chars)
A CharPredicate that returns true if the character is not equal to any character in chars.


not

public static CharPredicate not(CharPredicate predicate)
A CharPredicate that returns true if predicate evaluates to false.


and

public static CharPredicate and(CharPredicate predicate1,
                                CharPredicate predicate2)
A CharPredicate that returns true if both predicate1 and predicate2 evaluates to true.


or

public static CharPredicate or(CharPredicate predicate1,
                               CharPredicate predicate2)
A CharPredicate that returns true if either predicate1 or predicate2 evaluates to true.


and

public static CharPredicate and(CharPredicate... predicates)
A CharPredicate that returns true if all CharPredicate in predicates evaluate to true.


or

public static CharPredicate or(CharPredicate... predicates)
A CharPredicate that returns true if any CharPredicate in predicates evaluates to true.



Copyright © 2014. All rights reserved.