public class AutoSaver extends java.lang.Object implements ProverTaskListener
AutoSaver
instance saves periodically and the final proof state if it is closed.
The default save interval can be set using the static #init(int, boolean)
method.
Before the saver is registered as a listener, a proof must be set with setProof()
.
AutoSaver writes .key files to a temporary location (i.e., "/tmp" on most Linux machines).
These are possibly overwritten on each strategy run.
Write errors (e.g., missing permissions) are silently ignored.Modifier and Type | Field and Description |
---|---|
static SettingsListener |
settingsListener |
Constructor and Description |
---|
AutoSaver(int saveInterval,
boolean saveClosedProof)
Create a custom instance.
|
Modifier and Type | Method and Description |
---|---|
static AutoSaver |
getDefaultInstance()
Create a new instance using default values,
or null if auto save is disabled by default.
|
static void |
setDefaultValues(int saveInterval,
boolean saveClosedProof)
Set default values.
|
void |
setProof(Proof p)
Set the proof to be saved.
|
void |
taskFinished(TaskFinishedInfo info)
Called when a task is finished.
|
void |
taskProgress(int progress)
Saves the proof at the end of an interval.
|
void |
taskStarted(TaskStartedInfo info) |
public static final SettingsListener settingsListener
public AutoSaver(int saveInterval, boolean saveClosedProof)
saveInterval
- saveClosedProof
- public static void setDefaultValues(int saveInterval, boolean saveClosedProof)
saveInterval
- the interval (= number of proof steps) to periodically savesaveClosedProof
- whether to save the final closed proofpublic static AutoSaver getDefaultInstance()
AutoSaver.setDefaultValues()
public void setProof(Proof p)
p
- proof to save, must not be nullpublic void taskProgress(int progress)
taskProgress
in interface ProverTaskListener
progress
- indicates how much work has been done relative to the value of
size
passed in ProverTaskListener.taskStarted(TaskStartedInfo)
.java.lang.IllegalStateException
- if no proof was setpublic void taskStarted(TaskStartedInfo info)
taskStarted
in interface ProverTaskListener
public void taskFinished(TaskFinishedInfo info)
ProverTaskListener
taskFinished
in interface ProverTaskListener
info
- a TaskFinishedInfo object with additional informationCopyright © 2003-2019 The KeY-Project.