|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrvl.swv.AbstractEngine
public abstract class AbstractEngine
This is an abstract implementation of EngineInterface that can be extended to easily create an EngineInterface for a new piece of software.
To use, extend this class and define these variables in the constructor (defaults, if any, are shown):
engineName
codeExt
and outExt
commentStart
and commentEnd
startupCode
and endCode
okfigfmts
In most cases, only a few methods need to be overridden:
Field Summary | |
---|---|
java.lang.String |
codeExt
Extension to add to the file's base name for the code file (include the initial "dot") This should be unique to this engine. |
java.lang.String |
commentEnd
String to put after a comment in the code file. |
java.lang.String |
commentStart
String to put before a comment in the code file. |
java.lang.String |
endCode
Code to put at beginning of code file, before any code chunks |
java.lang.String |
engineName
Name of this engine -- used in error msgs and such |
java.lang.String |
medExt
Extension to add to intermediate file when post-processing is used. |
int[] |
okfigfmts
List of figure file formats supported by this engine |
java.lang.String |
outExt
Extension to add to the file's base name for the output file produced by running the code file (include the initial "dot") This should be unique to this engine, if possible |
java.lang.String |
startupCode
Code to put at beginning of code file, before any code chunks |
Constructor Summary | |
---|---|
AbstractEngine()
Default constructor |
Method Summary | |
---|---|
void |
closeCodeFile()
Close the code file |
void |
closeFig()
Put code to close the graphics file created by setupFig |
void |
deleteCodeFile()
Delete the code and output files |
java.lang.String[] |
getFileNames()
Return code and output file names |
boolean |
openCodeFile(java.lang.String baseName)
Open a file for saving the code. |
void |
postProcess()
Post-process the output file produced by runCode() .AbstractEngine does nothing but can override it |
void |
putCode(java.lang.String line)
Add a line of code to the code file |
void |
putComment(java.lang.String text)
Add a comment line to the source code |
void |
putExpr(java.lang.String expr)
Evaluate an expression and put it in the output stream |
void |
putSeparator(java.lang.String text)
Put code that will add the given text in a separate line of the engine's output. |
void |
putStartup(boolean weaving)
Startup code |
java.lang.Process |
runCode()
Run the code, and return its Process object |
void |
setBinary(java.lang.String binloc)
Set where to find the program to run on the code. |
void |
setParents(StatWeave parent,
FileInterface filei)
Set the parents that drive this instance |
FigFile |
setupFig(java.lang.String chunkName)
Put code that will set up a file to receive figure output This method uses the contents of okfigfmts and negotiates
with the current FileInterface to determine what
figure format to actually use, and how to size it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String engineName
public java.lang.String codeExt
public java.lang.String outExt
public java.lang.String medExt
null
and no post-processing
public java.lang.String commentStart
public java.lang.String commentEnd
public java.lang.String startupCode
public java.lang.String endCode
public int[] okfigfmts
Constructor Detail |
---|
public AbstractEngine()
Method Detail |
---|
public boolean openCodeFile(java.lang.String baseName)
openCodeFile
in interface EngineInterface
public void closeCodeFile()
closeCodeFile
in interface EngineInterface
public void deleteCodeFile()
deleteCodeFile
in interface EngineInterface
public java.lang.String[] getFileNames()
getFileNames
in interface EngineInterface
public void setParents(StatWeave parent, FileInterface filei)
setParents
in interface EngineInterface
public void setBinary(java.lang.String binloc)
setBinary
in interface EngineInterface
public void putCode(java.lang.String line)
putCode
in interface EngineInterface
public void putExpr(java.lang.String expr)
putExpr
in interface EngineInterface
public void putStartup(boolean weaving)
putStartup
in interface EngineInterface
public void putSeparator(java.lang.String text)
putSeparator
in interface EngineInterface
public void putComment(java.lang.String text)
putComment
in interface EngineInterface
public FigFile setupFig(java.lang.String chunkName)
okfigfmts
and negotiates
with the current FileInterface
to determine what
figure format to actually use, and how to size it.
The extending class should call this as a superclass method,
then use the properties of the returned object as needed in
outputting the needed setup code for the figure
setupFig
in interface EngineInterface
public void closeFig()
closeFig
in interface EngineInterface
public java.lang.Process runCode()
runCode
in interface EngineInterface
public void postProcess()
runCode()
.AbstractEngine
does nothing but can override it
postProcess
in interface EngineInterface
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |