Package jisa.experiment.queue
Class SimpleAction
- java.lang.Object
-
- jisa.experiment.queue.AbstractAction<java.lang.Void>
-
- jisa.experiment.queue.SimpleAction
-
- All Implemented Interfaces:
java.io.Serializable,Action<java.lang.Void>
- Direct Known Subclasses:
MeasurementSubAction
public class SimpleAction extends AbstractAction<java.lang.Void>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jisa.experiment.queue.Action
Action.Status
-
-
Constructor Summary
Constructors Constructor Description SimpleAction(java.lang.String name, SRunnable action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleActioncopy()Creates a deep copy of this action.java.util.List<Action>getChildren()Returns an unmodifiable list of sub-actions that this action contains.java.lang.VoidgetData()Returns whatever data this action generates.SimpleActionDisplaygetDisplay()Returns the JavaFX node used to display this action in an ActionQueueDisplay object.java.lang.ExceptiongetError()Returns the exception that caused the the action to result in failure.booleanisRunning()Returns whether the action is currently running or not.voidreset()Resets the action to the state it was in before being run.voidskip()Marks the action to be skipped next time it is run, or immediately if it is currently running.voidstart()Runs the action.voidstop()Interrupts and stops the action.-
Methods inherited from class jisa.experiment.queue.AbstractAction
addAttributeListener, addChildrenListener, addNameListener, addStatusListener, addTag, childrenChanged, clearTags, copyBasicParametersTo, getAttribute, getAttributes, getName, getStatus, getStatusListeners, getTags, hasAttribute, isCritical, onFinish, onStart, removeAttribute, removeListener, removeTag, setAttribute, setCritical, setName, setOnEdit, setOnFinish, setOnStart, setStatus, userEdit
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jisa.experiment.queue.Action
addListener, getAttributeString, getAttributeString, resume
-
-
-
-
Constructor Detail
-
SimpleAction
public SimpleAction(java.lang.String name, SRunnable action)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:ActionResets the action to the state it was in before being run.- Specified by:
resetin interfaceAction<java.lang.Void>- Specified by:
resetin classAbstractAction<java.lang.Void>
-
start
public void start()
Description copied from interface:ActionRuns the action. Should only return once the action is complete/interrupted/failed.- Specified by:
startin interfaceAction<java.lang.Void>- Specified by:
startin classAbstractAction<java.lang.Void>
-
stop
public void stop()
Description copied from interface:ActionInterrupts and stops the action.- Specified by:
stopin interfaceAction<java.lang.Void>- Specified by:
stopin classAbstractAction<java.lang.Void>
-
skip
public void skip()
Description copied from interface:ActionMarks the action to be skipped next time it is run, or immediately if it is currently running.- Specified by:
skipin interfaceAction<java.lang.Void>- Specified by:
skipin classAbstractAction<java.lang.Void>
-
getError
public java.lang.Exception getError()
Description copied from interface:ActionReturns the exception that caused the the action to result in failure.- Returns:
- Exception
-
isRunning
public boolean isRunning()
Description copied from interface:ActionReturns whether the action is currently running or not.- Specified by:
isRunningin interfaceAction<java.lang.Void>- Specified by:
isRunningin classAbstractAction<java.lang.Void>- Returns:
- Is it running?
-
getData
public java.lang.Void getData()
Description copied from interface:ActionReturns whatever data this action generates.- Specified by:
getDatain interfaceAction<java.lang.Void>- Specified by:
getDatain classAbstractAction<java.lang.Void>- Returns:
- Generated data
-
getChildren
public java.util.List<Action> getChildren()
Description copied from interface:ActionReturns an unmodifiable list of sub-actions that this action contains. The exact meaning of a sub-action and how it relates to the running of this action depends on the type of action this is.- Specified by:
getChildrenin interfaceAction<java.lang.Void>- Specified by:
getChildrenin classAbstractAction<java.lang.Void>- Returns:
- List of sub-actions
-
getDisplay
public SimpleActionDisplay getDisplay()
Description copied from interface:ActionReturns the JavaFX node used to display this action in an ActionQueueDisplay object.- Returns:
- Node
-
copy
public SimpleAction copy()
Description copied from interface:ActionCreates a deep copy of this action.- Returns:
- Deep copy of this action
-
-