001/*----------------------------------------------------------------------------*/
002/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj.command;
009
010/**
011 * This command will execute once, then finish immediately afterward.
012 *
013 * <p>Subclassing {@link InstantCommand} is shorthand for returning true from
014 * {@link Command isFinished}.
015 */
016public class InstantCommand extends Command {
017  public InstantCommand() {
018  }
019
020  /**
021   * Creates a new {@link InstantCommand InstantCommand} with the given name.
022   * @param name the name for this command
023   */
024  public InstantCommand(String name) {
025    super(name);
026  }
027
028  protected boolean isFinished() {
029    return true;
030  }
031}