public class InstantCommand extends Command
Subclassing InstantCommand
is shorthand for returning true from
isFinished
.
Constructor and Description |
---|
InstantCommand() |
InstantCommand(java.lang.String name)
Creates a new
InstantCommand with the given name. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isFinished()
Returns whether this command is finished.
|
cancel, clearRequirements, doesRequire, end, execute, getGroup, getName, getSmartDashboardType, getTable, initialize, initTable, interrupted, isCanceled, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setRunWhenDisabled, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
public InstantCommand()
public InstantCommand(java.lang.String name)
InstantCommand
with the given name.name
- the name for this commandprotected boolean isFinished()
Command
end()
will be called.
It may be useful for a team to reference the isTimedOut()
method for time-sensitive commands.
Returning false will result in the command never ending automatically. It may still be
cancelled manually or interrupted by another command. Returning true will result in the
command executing once and finishing immediately. We recommend using InstantCommand
for this.
isFinished
in class Command
isTimedOut()