org.grinvin.engine

Class EngineRunner

Implemented Interfaces:
Runnable

public class EngineRunner
extends java.lang.Object
implements Runnable

Object which can be used to run a given conjecturing engine in a background thread.

Allows listeners to be notified when the run starts and when it ends.

Nested Class Summary

class
EngineRunner.Status

Constructor Summary

EngineRunner(Engine engine, GraphInvariantList model)
Construct a runner object for the given engine.

Method Summary

void
addChangeListener(ChangeListener l)
Register an object which is informed of changes in the 'running' state of this runner.
protected void
fireStateChanged()
Notify every listener of a change in state.
Engine
getEngine()
Return the associated engine.
String
getResult()
Return the latest result generated by the engine (may be null).
List
getSortedUsableInvariants()
EngineRunner.Status
getStatus()
List
getUsableInvariants()
void
removeChangeListener(ChangeListener l)
Remove a change listener.
void
run()
Extract the invariant values from the table and run the engine.

Constructor Details

EngineRunner

public EngineRunner(Engine engine,
                    GraphInvariantList model)
Construct a runner object for the given engine.

Method Details

addChangeListener

public void addChangeListener(ChangeListener l)
Register an object which is informed of changes in the 'running' state of this runner.

fireStateChanged

protected void fireStateChanged()
Notify every listener of a change in state.

getEngine

public Engine getEngine()
Return the associated engine.

getResult

public String getResult()
Return the latest result generated by the engine (may be null).

getSortedUsableInvariants

public List getSortedUsableInvariants()

getStatus

public EngineRunner.Status getStatus()

getUsableInvariants

public List getUsableInvariants()

removeChangeListener

public void removeChangeListener(ChangeListener l)
Remove a change listener.

run

public void run()
Extract the invariant values from the table and run the engine. Changes are reported to all listeners in the event dispatching thread, even when this method is run in a different thread (which is generally a good idea).