|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.yale.Experiment
public class Experiment
This class was introduced to avoid confusing handling of operator maps and other stuff when a new experiment is created.
Field Summary | |
---|---|
private java.util.List<BreakpointListener> |
breakpointListeners
|
private Operator |
currentOperator
|
private java.util.Map<java.lang.String,DataTable> |
dataTableMap
Maps names of ExperimentLogOperators to Objects, that these Operators use for collecting statistics (objects of type DataTable ). |
private java.io.File |
experimentFile
|
private MacroHandler |
macroHandler
|
private java.util.Map<java.lang.String,Operator> |
operatorNameMap
|
private ExperimentOperator |
rootOperator
|
private boolean |
stopExperiment
|
Constructor Summary | |
---|---|
Experiment()
Constructs an experiment consisting only of a SimpleOperatorChain. |
|
Experiment(java.io.File file)
|
|
Experiment(java.io.InputStream in)
Reads an experiment configuration from the given file. |
|
Experiment(java.lang.String xmlString)
Reads an experiment configuration from an XML String. |
|
Experiment(java.net.URL url)
|
Method Summary | |
---|---|
void |
addBreakpointListener(BreakpointListener listener)
|
DataTable |
addDataTable(DataTable table)
Returns the data table associated with the given name. |
boolean |
checkExperiment(IOContainer inputContainer)
Checks for correct number of inner operators, properties, and io. |
private int |
checkIO(IOContainer inputContainer)
|
private int |
checkNumberOfInnerOperators()
|
private int |
checkProperties()
|
void |
clearDataTables()
Removes all data tables before running a new experiment. |
void |
clearMacros()
|
java.io.File |
createFile(java.lang.String name)
|
boolean |
dataTableExists(java.lang.String name)
Returns true if a data table object with the given name exists. |
void |
fireBreakpointEvent(Operator operator,
IOContainer ioContainer,
int location)
|
void |
fireResumeEvent()
|
java.util.Collection<java.lang.String> |
getAllOperatorNames()
Returns a Set view of all operator names (i.e. |
java.util.Collection<Operator> |
getAllOperators()
Returns a Collection view of all operators. |
Operator |
getCurrentOperator()
Returns the operator that is currently being executed. |
DataTable |
getDataTable(java.lang.String name)
Returns the data table associated with the given name. |
java.util.Collection |
getDataTables()
|
java.io.File |
getExperimentFile()
|
java.lang.String |
getFirstFreeName(java.lang.String name)
Returns a "name (i)" if name is already in use. |
MacroHandler |
getMacroHandler()
|
Operator |
getOperator(java.lang.String name)
Returns the operator with the given name. |
ExperimentOperator |
getRootOperator()
|
private int |
performAdditionalChecks()
|
private void |
prepareRun(IOContainer inputContainer)
|
void |
readExperiment(java.io.InputStream in)
|
void |
registerOperator(java.lang.String name,
Operator operator)
Registers the operator as part of the experiment. |
void |
removeBreakpointListener(BreakpointListener listener)
|
java.io.File |
resolveFileName(java.lang.String name)
Resolves the given filename against the directory containing the experiment file. |
IOContainer |
run()
Starts the experiment with no input. |
IOContainer |
run(IOContainer input)
Starts the experiment with the given input. |
void |
save()
Saves the experiment to the experiment file. |
void |
save(java.io.File file)
Saves the experiment to the experiment file. |
void |
setCurrentOperator(Operator operator)
Returns the operator that is currently being executed. |
void |
setExperimentFile(java.io.File file)
|
void |
setupFromXML(java.lang.String xmlString)
|
boolean |
shouldStop()
Returns true iff the experiment should be stopped. |
void |
stop()
Stops the experiment as soon as possible. |
private void |
tearDown()
|
void |
unRegisterOperator(java.lang.String name)
Unregisters the operator as part of the experiment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ExperimentOperator rootOperator
private Operator currentOperator
private java.util.Map<java.lang.String,Operator> operatorNameMap
private java.io.File experimentFile
private java.util.List<BreakpointListener> breakpointListeners
private boolean stopExperiment
private MacroHandler macroHandler
private java.util.Map<java.lang.String,DataTable> dataTableMap
DataTable
).
Constructor Detail |
---|
public Experiment()
public Experiment(java.net.URL url) throws java.io.IOException, XMLException
java.io.IOException
XMLException
public Experiment(java.io.File file) throws java.io.IOException, XMLException
java.io.IOException
XMLException
public Experiment(java.lang.String xmlString) throws java.io.IOException, XMLException
java.io.IOException
XMLException
public Experiment(java.io.InputStream in) throws java.io.IOException, XMLException
java.io.IOException
XMLException
Method Detail |
---|
public MacroHandler getMacroHandler()
public void clearMacros()
public boolean dataTableExists(java.lang.String name)
public DataTable addDataTable(DataTable table)
public DataTable getDataTable(java.lang.String name)
public java.util.Collection getDataTables()
public void clearDataTables()
public ExperimentOperator getRootOperator()
public void setupFromXML(java.lang.String xmlString) throws java.io.IOException, XMLException
java.io.IOException
XMLException
public java.io.File getExperimentFile()
public java.lang.String getFirstFreeName(java.lang.String name)
public void registerOperator(java.lang.String name, Operator operator)
public void unRegisterOperator(java.lang.String name)
public Operator getOperator(java.lang.String name)
public Operator getCurrentOperator()
public java.util.Collection<Operator> getAllOperators()
public java.util.Collection<java.lang.String> getAllOperatorNames()
public void setCurrentOperator(Operator operator)
public void addBreakpointListener(BreakpointListener listener)
public void removeBreakpointListener(BreakpointListener listener)
public void fireBreakpointEvent(Operator operator, IOContainer ioContainer, int location)
public void fireResumeEvent()
private int checkIO(IOContainer inputContainer)
private int checkNumberOfInnerOperators()
private int checkProperties()
private int performAdditionalChecks()
public boolean checkExperiment(IOContainer inputContainer)
private void prepareRun(IOContainer inputContainer) throws OperatorException
OperatorException
public IOContainer run() throws OperatorException
OperatorException
public IOContainer run(IOContainer input) throws OperatorException
OperatorException
public void stop()
public boolean shouldStop()
private void tearDown()
public void save() throws java.io.IOException
java.io.IOException
public void save(java.io.File file) throws java.io.IOException
java.io.IOException
public void setExperimentFile(java.io.File file)
public java.io.File resolveFileName(java.lang.String name)
public java.io.File createFile(java.lang.String name)
public void readExperiment(java.io.InputStream in) throws XMLException, java.io.IOException
XMLException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |