- java.lang.Object
-
- io.github.interacto.command.CommandImpl
-
- io.github.interacto.command.library.InstrumentCommand
-
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
ActivateInstrument,InactivateInstrument
public abstract class InstrumentCommand extends CommandImpl
This command manipulates an instrument.- Author:
- Arnaud Blouin
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.github.interacto.command.Command
Command.CmdStatus, Command.RegistrationPolicy
-
-
Field Summary
Fields Modifier and Type Field Description protected Instrument<?>instrumentThe manipulated instrument.-
Fields inherited from class io.github.interacto.command.CommandImpl
status
-
-
Constructor Summary
Constructors Constructor Description InstrumentCommand()Creates the command.InstrumentCommand(Instrument<?> instrument)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDo()Checks whether the command can be executed.voidflush()Flushes the command.Instrument<?>getInstrument()voidsetInstrument(Instrument<?> newInstrument)Sets the manipulated instrument.-
Methods inherited from class io.github.interacto.command.CommandImpl
cancel, createMemento, doCmdBody, doIt, done, getRegistrationPolicy, getStatus, hadEffect, isDone, toString, unregisteredBy
-
-
-
-
Field Detail
-
instrument
protected Instrument<?> instrument
The manipulated instrument.
-
-
Constructor Detail
-
InstrumentCommand
public InstrumentCommand()
Creates the command.
-
InstrumentCommand
public InstrumentCommand(Instrument<?> instrument)
-
-
Method Detail
-
flush
public void flush()
Description copied from interface:CommandFlushes the command. Can be useful to close streams, free objects, etc. A command should flushed manually only when it is not managed by the cmd registry of the application. When a command is gathered and managed by a command registry, it is automatically flushed when the command registry removes the cmd.- Specified by:
flushin interfaceCommand- Overrides:
flushin classCommandImpl
-
canDo
public boolean canDo()
Description copied from interface:CommandChecks whether the command can be executed.- Specified by:
canDoin interfaceCommand- Overrides:
canDoin classCommandImpl- Returns:
- True if the command can be executed.
-
getInstrument
public Instrument<?> getInstrument()
- Returns:
- The manipulated instrument.
-
setInstrument
public void setInstrument(Instrument<?> newInstrument)
Sets the manipulated instrument.- Parameters:
newInstrument- The manipulated instrument.
-
-