|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lonniepryor.blues.util.Characters
Specification interface for identifying Characters. Instances of this class may be logically combined using the AND, OR, and NOT operations. Instances may also be sequentially constructed using the Builder class. Many common use-cases are supplied via static accessor methods.
Constructor Summary | |
protected |
Characters()
Creates a new Characters object. |
Method Summary | |
Characters |
and(Characters specification)
Returns a specification representing a logical AND of this specification on the left and the supplied specification on the right. |
static Characters |
digits()
Returns a specification satisfied by digit characters. |
static Characters |
equalTo(char c)
Returns a specification satisfied by the specified character. |
protected abstract boolean |
isSatisfiedBy(char canidate)
Returns true if the specified char satisfies this specification. |
boolean |
isSatisfiedByAll(char[] all)
Returns true if all of the supplied Characters satisfy this specification. |
boolean |
isSatisfiedByAny(char[] any)
Returns true if any of the supplied Characters satisfy this specification. |
static Characters |
letters()
Returns a specification satisfied by letter characters. |
static Characters |
lowerCase()
Returns a specification satisfied by upper case characters. |
Characters |
not()
Returns a specification representing a logical NOT of this specification. |
Characters |
or(Characters specification)
Returns a specification representing a logical OR of this specification on the left and the supplied specification on the right. |
char[] |
selectAll(char[] from)
Selects all the Characters that satisfy this specification from the supplied array. |
char |
selectFirst(char[] from)
Selects the first Characters that satisfies this specification from the supplied array. |
static Characters |
upperCase()
Returns a specification satisfied by upper case characters. |
static Characters |
whitespace()
Returns a specification satisfied by whitespace characters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Characters()
Method Detail |
public static Characters digits()
public static Characters letters()
public static Characters lowerCase()
public static Characters upperCase()
public static Characters whitespace()
public static Characters equalTo(char c)
c
- The character to match to.
protected abstract boolean isSatisfiedBy(char canidate)
canidate
- The character to test.
public final boolean isSatisfiedByAll(char[] all)
all
- The array of Characters to test.
public final boolean isSatisfiedByAny(char[] any)
any
- The array of Characters to test.
public final char selectFirst(char[] from)
from
- The array to select from.
public final char[] selectAll(char[] from)
from
- The array to select from.
public final Characters and(Characters specification)
specification
- The specification to AND with.
public final Characters or(Characters specification)
specification
- The specification to OR with.
public final Characters not()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |