|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcds.simbad.SesameCommand
Contains one sesame command and its different regular expressions and strings.
Such a command is made of
a condition, defining the identifiers that should be treated. Absence of condition means that the command should be applied to any identifier
a substitution command made of a regular expression (or a simple string) defining what should be substituted, and a string defining the new character. This string may contain references to parts of the regular expression.
Field Summary | |
private int |
cmdnum
|
private java.util.regex.Pattern |
pCond
|
private java.util.regex.Pattern |
pFind
|
private java.lang.String |
sReplace
|
Constructor Summary | |
SesameCommand(java.lang.String cond,
java.lang.String condOpt,
java.lang.String find,
java.lang.String findOpt,
java.lang.String replace,
int num)
Create a SesameCommand from its elements |
Method Summary | |
private java.lang.String |
getFlags(int flags)
returns a string containing the existing flags |
private int |
setFlags(java.lang.String str)
Defines the flag integer from a list of flags in an ascii string. |
java.lang.String |
substitute(java.lang.String id)
Applies the substitution part of the sesame object to the identifier if the condition is matched |
java.lang.String |
toString()
Display a SesameCommand object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private int cmdnum
private java.util.regex.Pattern pCond
private java.util.regex.Pattern pFind
private java.lang.String sReplace
Constructor Detail |
public SesameCommand(java.lang.String cond, java.lang.String condOpt, java.lang.String find, java.lang.String findOpt, java.lang.String replace, int num) throws SesameException
cond
- the condition, regular expression defining if an identifier
should be treated by this command or notcondOpt
- options string for the cond r.e. ('i' for case insensitive)find
- the string to find in the identifier (it can be a regular
expression), to be substitudedfindOpt
- options string for the find r.e. ('i' for case insensitive)replace
- string to replace the 'find' part in the identifiernum
- a number identifying the sesame command. It can usefully be
the line number in the file from which the sesame command are foundMethod Detail |
private int setFlags(java.lang.String str)
str
- String containing the reg. expr. flags
private java.lang.String getFlags(int flags)
flags
- regular expression flags
public java.lang.String substitute(java.lang.String id)
id
- identifier to transform if the sesame condition matches
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |