|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.ejen.util.arl.ArlUtil
ArlUtil class utility (static methods).
"ARL" stands for "ARray Language". It is a very basic language that allows
to set elements of an int array to one of three flag values:
F_ACCEPT, F_REMOVE or F_CROSS.
An ARL sequence looks like "~23;+34;-45;-[46,56];..." The
meaning of this expression is: "set the 23th element of the array to
F_CROSS; set the 34th element to F_ACCEPT; set
the 45th to F_REMOVE; set all elements between and including
the 46th and the 56th to F_REMOVE;..."
Order is important: "-[23,56];~34" means "set all elements of
the array between and including 23 and 56 to F_REMOVE; then
set the 34th element to F_CROSS". On the other hand,
"~34;-[23,56]" is strictly identical to "-[23,56]".
The "+" sign (for F_ACCEPT) is optional: "+45" is identical
to "45".
This language is used for parsers control
(see JavaSourceToXML.process(ExpressionContext,String,String,String),
SimpleNode.toNode(Document,Node,int[],int[],boolean)
and Token.toNode(Document,Node,int[],boolean)).
| Field Summary | |
static int |
F_ACCEPT
|
static int |
F_CROSS
|
static int |
F_REMOVE
|
| Fields inherited from interface org.ejen.util.arl.ArlParserTreeConstants |
JJTARLEXP, JJTARLSEQUENCE, JJTINTERVAL, jjtNodeName |
| Fields inherited from interface org.ejen.util.arl.ArlParserConstants |
ACCEPT, CROSS, DEFAULT, EOF, INTEGER, REMOVE, tokenImage |
| Constructor Summary | |
protected |
ArlUtil()
Prevents intanciation. |
| Method Summary | |
static int[] |
process(String arl,
int[] array)
Returns the array parameter whose elements are set according to the arl parameter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int F_ACCEPT
public static final int F_REMOVE
public static final int F_CROSS
| Constructor Detail |
protected ArlUtil()
| Method Detail |
public static int[] process(String arl,
int[] array)
arl - an ARL sequence.array - the array to modify.
WrappedRuntimeException - parse exception,
array out of bound exception...
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||