|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.media.mn8.util.SimpleExpression
The SimpleExpression class implements a simple expression parser. The only operators of a simple expression are:
String
Constructor Summary | |
SimpleExpression()
|
Method Summary | |
static boolean |
contains(String target,
String pattern)
|
protected static boolean |
isOperator(String target)
|
protected static int |
lookAhead(String token,
String target,
int targetIndex)
Tries to find the token in the target string starting with the targetIndex position. |
protected static String[] |
makeTokens(String pattern)
|
static boolean |
match(String target,
String pattern)
Specifies if a pattern matches the target string or not. |
protected static int |
operatorOccurences(String target,
String operator)
|
static Collection |
select(String target,
String pattern)
Selects a collection of strings from the target using as mask the pattern and the two operators "#" and "*". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleExpression()
Method Detail |
public static Collection select(String target, String pattern)
target
- The string to be matchedpattern
- The pattern
Collection
,
Vector
public static boolean match(String target, String pattern)
target
- The string to be matchedpattern
- The pattern
public static boolean contains(String target, String pattern)
protected static int lookAhead(String token, String target, int targetIndex)
token
- The token to be looked for.target
- The string where we look for the token.targetIndex
- the position in the target where we begin the search.
protected static String[] makeTokens(String pattern)
protected static int operatorOccurences(String target, String operator)
protected static boolean isOperator(String target)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |