001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2016-2017. 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
018  public InstantCommand() {
019  }
020
021  /**
022   * Creates a new {@link InstantCommand InstantCommand} with the given name.
023   * @param name the name for this command
024   */
025  public InstantCommand(String name) {
026    super(name);
027  }
028
029  protected boolean isFinished() {
030    return true;
031  }
032}