http://www.jpicedt.org

jpicedt.format.input.util
Class AlternateExpression

java.lang.Object
  extended byjpicedt.format.input.util.AbstractRegularExpression
      extended byjpicedt.format.input.util.AlternateExpression
All Implemented Interfaces:
ExpressionConstants
Direct Known Subclasses:
EepicLineThicknessExpression, EndPsPictureExpression, PicBezierExpression, PicColorExpression, PicGroupExpression, RootExpression, UserDefinedColorExpression

public class AlternateExpression
extends AbstractRegularExpression

A regular expression that mimics the "x|y" RegExp syntax.

Since:
jpicedt 1.3
Version:
$Id: AlternateExpression.java,v 1.4.2.1 2007/09/02 11:56:13 reynal Exp $
Author:
Sylvain Reynal

Field Summary
 
Fields inherited from interface jpicedt.format.input.util.ExpressionConstants
ANY_CHAR, ANY_CHAR_EOL, ANY_SIGN, AT_LEAST, AT_MOST, DEBUG, DOUBLE, EOL, EXACTLY, INTEGER, NEGATIVE, NON_NULL, POSITIVE, STRICTLY_NEGATIVE, STRICTLY_POSITIVE, WHITE_SPACES, WHITE_SPACES_OR_EOL
 
Constructor Summary
AlternateExpression()
          Creates a new AlternateExpression with no element
AlternateExpression(AbstractRegularExpression expr)
          Creates a new AlternateExpression with the given expr as first element
AlternateExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2)
          Creates a new AlternateExpression with the given expr as first and second element
AlternateExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2, AbstractRegularExpression expr3)
          Creates a new AlternateExpression with the given expr as first, second and third element
 
Method Summary
 void add(AbstractRegularExpression expr)
          Add a new child to this AlternateExpression.
 ArrayList getExpressionList()
          Return a list containing every expression in this AlternateExpression
 boolean interpret(Context c)
          Calls "action" with value=Integer(index of first expression parsed with success, starting from 0).
 String toString()
           
 
Methods inherited from class jpicedt.format.input.util.AbstractRegularExpression
action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlternateExpression

public AlternateExpression(AbstractRegularExpression expr)
Creates a new AlternateExpression with the given expr as first element


AlternateExpression

public AlternateExpression(AbstractRegularExpression expr1,
                           AbstractRegularExpression expr2)
Creates a new AlternateExpression with the given expr as first and second element


AlternateExpression

public AlternateExpression(AbstractRegularExpression expr1,
                           AbstractRegularExpression expr2,
                           AbstractRegularExpression expr3)
Creates a new AlternateExpression with the given expr as first, second and third element


AlternateExpression

public AlternateExpression()
Creates a new AlternateExpression with no element

Method Detail

add

public void add(AbstractRegularExpression expr)
Add a new child to this AlternateExpression.


interpret

public boolean interpret(Context c)
                  throws REParserException
Calls "action" with value=Integer(index of first expression parsed with success, starting from 0).

Specified by:
interpret in class AbstractRegularExpression
Returns:
TRUE as soon as one of the expressions contained in this AlternateExpression has been found ; FALSE if no match.

Throws:
REParserException - if an error occur during parsing

getExpressionList

public ArrayList getExpressionList()
Return a list containing every expression in this AlternateExpression


toString

public String toString()

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org