Package jpicedt.format.input.util
Class AlternateExpression
- java.lang.Object
-
- jpicedt.format.input.util.AbstractRegularExpression
-
- jpicedt.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
Constructors Constructor Description AlternateExpression()Creates a new AlternateExpression with no elementAlternateExpression(AbstractRegularExpression expr)Creates a new AlternateExpression with the given expr as first elementAlternateExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2)Creates a new AlternateExpression with the given expr as first and second elementAlternateExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2, AbstractRegularExpression expr3)Creates a new AlternateExpression with the given expr as first, second and third element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(AbstractRegularExpression expr)Add a new child to this AlternateExpression.java.util.ArrayListgetExpressionList()Return a list containing every expression in this AlternateExpressionbooleaninterpret(Context c)Calls "action" with value=Integer(index of first expression parsed with success, starting from 0).java.lang.StringtoString()-
Methods inherited from class jpicedt.format.input.util.AbstractRegularExpression
action
-
-
-
-
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:
interpretin classAbstractRegularExpression- 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 java.util.ArrayList getExpressionList()
Return a list containing every expression in this AlternateExpression
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-