Package lib.commands

Class SwitchingIfElseCommand

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
lib.commands.SwitchingIfElseCommand
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable

public class SwitchingIfElseCommand extends edu.wpi.first.wpilibj2.command.Command
  • Nested Class Summary

    Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command

    edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
  • Constructor Summary

    Constructors
    Constructor
    Description
    SwitchingIfElseCommand(edu.wpi.first.wpilibj2.command.Command onTrue, edu.wpi.first.wpilibj2.command.Command onFalse, BooleanSupplier... conditions)
    Similar to RunIfElse, but will switch which command is running mid-execution if the supplier changes.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    end(boolean interrupted)
     
    void
     
    edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
     
    void
     
    boolean
     
    boolean
     

    Methods inherited from class edu.wpi.first.wpilibj2.command.Command

    addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SwitchingIfElseCommand

      public SwitchingIfElseCommand(edu.wpi.first.wpilibj2.command.Command onTrue, edu.wpi.first.wpilibj2.command.Command onFalse, BooleanSupplier... conditions)
      Similar to RunIfElse, but will switch which command is running mid-execution if the supplier changes.
  • Method Details

    • initialize

      public void initialize()
      Overrides:
      initialize in class edu.wpi.first.wpilibj2.command.Command
    • execute

      public void execute()
      Overrides:
      execute in class edu.wpi.first.wpilibj2.command.Command
    • end

      public void end(boolean interrupted)
      Overrides:
      end in class edu.wpi.first.wpilibj2.command.Command
    • isFinished

      public boolean isFinished()
      Overrides:
      isFinished in class edu.wpi.first.wpilibj2.command.Command
    • runsWhenDisabled

      public boolean runsWhenDisabled()
      Overrides:
      runsWhenDisabled in class edu.wpi.first.wpilibj2.command.Command
    • getInterruptionBehavior

      public edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior getInterruptionBehavior()
      Overrides:
      getInterruptionBehavior in class edu.wpi.first.wpilibj2.command.Command