Class Command

java.lang.Object
edu.wisc.ssec.mcidasv.jython.Command
Direct Known Subclasses:
BatchCommand, EjectCommand, InjectCommand, LineCommand, LoadFileCommand, RegisterCallbackCommand

public abstract class Command extends Object
A Command is an action that can alter the state of an Interpreter.
  • Field Details

    • console

      protected Console console
      Console that created this command.
  • Constructor Details

    • Command

      public Command(Console console)
      Creates a command.
      Parameters:
      console - Console that created this command.
  • Method Details

    • execute

      public abstract void execute(Interpreter interpreter) throws Exception
      Hook to provide various implementations of command execution.
      Parameters:
      interpreter - Jython interpreter that will execute the command.
      Throws:
      Exception - An error was encountered executing the command. Jython will catch three standard Python exceptions: SyntaxError, ValueError, and OverflowError. Other exceptions are thrown.
    • getInputStream

      protected InputStream getInputStream(String path) throws Exception
      Creates a InputStream using path. It's here entirely for convenience.
      Parameters:
      path - Path to the desired file.
      Returns:
      {code InputStream} for path.
      Throws:
      Exception - if there was badness.