|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.string.WildcardExpression
Tests strings against wildcard expressions.
Details: A WildcardExpression
is a template for testing whether strings belong in a certain string class. WildcardExpression
s can contain any number of literal characters and the two supported wildcard characters, '?' and '*', which are understood in the usual command shell fashion:
Constructor Summary | |
WildcardExpression(java.lang.String expression)
Sets expression string. |
|
WildcardExpression(java.lang.String expression,
java.lang.String excludes)
Reserved. |
Method Summary | |
boolean |
accept(java.lang.String cand)
Tests string. |
static java.lang.String |
normalize(java.lang.String expression)
Normalizes expression. |
java.lang.String |
toString()
Returns string representation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WildcardExpression(java.lang.String expression, java.lang.String excludes)
Details: Reserved for future implementation. Constructs a WildcardExpression
using the given String
. Wildcards '?' and '*' will not be allowed to match characters in the excludes
string.
expression
- the wildcard expressionexcludes
- a list of character that should not be wild-matchedpublic WildcardExpression(java.lang.String expression)
Details: Constructs a WildcardExpression
using the given String
.
Method Detail |
public static java.lang.String normalize(java.lang.String expression)
Details: Normalizes a wildcard expression by expressing it in canonical form. The canonical form of a wildcard expression does not contain the substrings "*?" or "**". For any given wildcard expression, the canonical form of that expression is uniquely defined. Any two equivalent wildcard expressions have the same canonical form.
expression
- the expression to normalizepublic boolean accept(java.lang.String cand)
Details: accept
tests the given string against this wildcard expression.
cand
- the string to testtrue
if the string passes, false
otherwisepublic java.lang.String toString()
Details: toString
returns this wildcard expression as a string. The returned string may not be identical to the string passed to the constructor, but it will be equivalent.
toString
in class java.lang.Object
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |