org.jactr.tools.itr
Class ZipDataListener

java.lang.Object
  extended by org.jactr.tools.itr.ZipDataListener
All Implemented Interfaces:
org.jactr.core.utils.parameter.IParameterized, IIterativeRunListener

public class ZipDataListener
extends java.lang.Object
implements IIterativeRunListener, org.jactr.core.utils.parameter.IParameterized

dump the output of an iterative run to a zip archive

Author:
harrison

Field Summary
static java.lang.String FILENAME
           
 
Constructor Summary
ZipDataListener()
           
 
Method Summary
 void exceptionThrown(int index, org.jactr.core.model.IModel model, java.lang.Throwable thrown)
          called if something goes horribly wrong.
 java.lang.String getParameter(java.lang.String key)
           
 java.util.Collection<java.lang.String> getPossibleParameters()
           
 java.util.Collection<java.lang.String> getSetableParameters()
           
 void postRun(int currentRunIndex, int totalRuns, java.util.Collection<org.jactr.core.model.IModel> models)
           
 void preBuild(int currentRunIndex, int totalRuns, java.util.Collection<org.antlr.runtime.tree.CommonTree> modelDescriptors)
          called before each build of the models in the IterativeMain.
 void preLoad(int currentRunIndex, int totalRuns)
           
 void preRun(int currentRunIndex, int totalRuns, java.util.Collection<org.jactr.core.model.IModel> models)
          called before the run starts
 void setParameter(java.lang.String key, java.lang.String value)
           
 void start(int totalRuns)
          create the zip file
 void stop()
          clean up
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME

public static final java.lang.String FILENAME
See Also:
Constant Field Values
Constructor Detail

ZipDataListener

public ZipDataListener()
Method Detail

exceptionThrown

public void exceptionThrown(int index,
                            org.jactr.core.model.IModel model,
                            java.lang.Throwable thrown)
Description copied from interface: IIterativeRunListener
called if something goes horribly wrong. This can be invoked at any of three locations:

During a model execution (in which case index>=1, model!=null)

If something goes wrong after the run during cleanup (index>=1, model==null)

or at the end if something goes wrong (index==0, model==null)

Specified by:
exceptionThrown in interface IIterativeRunListener

postRun

public void postRun(int currentRunIndex,
                    int totalRuns,
                    java.util.Collection<org.jactr.core.model.IModel> models)
Specified by:
postRun in interface IIterativeRunListener

preBuild

public void preBuild(int currentRunIndex,
                     int totalRuns,
                     java.util.Collection<org.antlr.runtime.tree.CommonTree> modelDescriptors)
Description copied from interface: IIterativeRunListener
called before each build of the models in the IterativeMain. This gives the listener a chance to tweak the models before they are constructed

Specified by:
preBuild in interface IIterativeRunListener
modelDescriptors - all the descriptors of the models to be created.

preRun

public void preRun(int currentRunIndex,
                   int totalRuns,
                   java.util.Collection<org.jactr.core.model.IModel> models)
Description copied from interface: IIterativeRunListener
called before the run starts

Specified by:
preRun in interface IIterativeRunListener

start

public void start(int totalRuns)
create the zip file

Specified by:
start in interface IIterativeRunListener

stop

public void stop()
clean up

Specified by:
stop in interface IIterativeRunListener

getParameter

public java.lang.String getParameter(java.lang.String key)
Specified by:
getParameter in interface org.jactr.core.utils.parameter.IParameterized

getPossibleParameters

public java.util.Collection<java.lang.String> getPossibleParameters()
Specified by:
getPossibleParameters in interface org.jactr.core.utils.parameter.IParameterized

getSetableParameters

public java.util.Collection<java.lang.String> getSetableParameters()
Specified by:
getSetableParameters in interface org.jactr.core.utils.parameter.IParameterized

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Specified by:
setParameter in interface org.jactr.core.utils.parameter.IParameterized

preLoad

public void preLoad(int currentRunIndex,
                    int totalRuns)
Specified by:
preLoad in interface IIterativeRunListener