Class StatefulCommand

  • All Implemented Interfaces:
    edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Command

    public class StatefulCommand
    extends edu.wpi.first.wpilibj2.command.CommandBase
    A command that iterates through a list of states subclass-defined states.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Runnable default_action  
      • Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        m_requirements
    • Constructor Summary

      Constructors 
      Constructor Description
      StatefulCommand​(java.lang.Enum<?> state)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      java.lang.Enum<?> getCallingState()  
      java.lang.Enum<?> getState()  
      void initialize()  
      boolean isFinished()  
      protected java.lang.String methodName​(java.lang.Enum<?> state)  
      protected void setDefaultAction​(java.lang.Runnable action)  
      void setState​(java.lang.Enum<?> new_state)  
      • Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase

        addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface edu.wpi.first.wpilibj2.command.Command

        alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, end, hasRequirement, isScheduled, perpetually, raceWith, runsWhenDisabled, schedule, schedule, until, withInterrupt, withTimeout
    • Field Detail

      • default_action

        protected java.lang.Runnable default_action
    • Constructor Detail

      • StatefulCommand

        public StatefulCommand​(java.lang.Enum<?> state)
    • Method Detail

      • setState

        public void setState​(java.lang.Enum<?> new_state)
      • getState

        public java.lang.Enum<?> getState()
      • getCallingState

        public java.lang.Enum<?> getCallingState()
      • setDefaultAction

        protected void setDefaultAction​(java.lang.Runnable action)
      • initialize

        public void initialize()
      • isFinished

        public boolean isFinished()
      • methodName

        protected java.lang.String methodName​(java.lang.Enum<?> state)
      • execute

        public void execute()