Package xal.smf.impl

Class WireScanner.CmdPck

java.lang.Object
xal.smf.impl.WireScanner.CmdPck
Enclosing class:
WireScanner

public static class WireScanner.CmdPck extends Object
A class-level representation of a wire-scanner command. This class must also be used for commands with arguments. Specifically, the command argument is packaged together with a WireScanner.CMD instance to form a complete command.
Since:
May 21, 2010
Author:
Christopher K. Allen
  • Constructor Details

    • CmdPck

      public CmdPck(WireScanner.CMD cmd)
      Create a new Cmd object for the given CMD and no arguments.
      Parameters:
      cmd - the wire scanner command
      Since:
      May 21, 2010
    • CmdPck

      public CmdPck(WireScanner.CMD cmd, Number... args)
      Create a new Cmd object for the given CMD and given arguments.
      Parameters:
      cmd - the wire scanner command
      args - the arguments of the command (may be empty)
      Since:
      May 21, 2010
    • CmdPck

      public CmdPck(WireScanner.CMD cmd, WireScanner.CMDARG arg, Number... addargs)
      Create a new Cmd object for the given WireScanner.CMD and the given WireScanner.CMDARG argment and any addition arguments addargs.
      Parameters:
      cmd - the wire scanner command
      arg - pre-defined command argument
      addargs - additional arguments of the command (may be empty)
      Since:
      May 24, 2010
  • Method Details

    • getArgumentCount

      public int getArgumentCount()
      Return the number of arguments in this command. Currently there is a maximum of three.
      Returns:
      Number of command arguments
      Since:
      May 21, 2010
    • getCommand

      public WireScanner.CMD getCommand()
      Returns the command constant of this command instance, that is, an element of the enumeration CMD.
      Returns:
      Command code enumeration for this command
      Since:
      May 21, 2010
    • getArgument

      public Number getArgument()
      Returns the argument of this command. This method is actually a shortcut for the method call

          getArgument(int)

      for the argument of 0. Specially, use this method if there is only one argument to the command.
      Returns:
      the command argument
      Since:
      May 21, 2010
    • getArgument

      public Number getArgument(int index) throws IllegalArgumentException
      Return the command argument at the given index. Note that the argument index value must be strictly less than the argument count.
      Parameters:
      index - the command argument index
      Returns:
      the command argument at the given index
      Throws:
      IllegalArgumentException - the given index is too large for the number of arguments in this command
      Since:
      May 21, 2010
    • toString

      public String toString()
      Returns a string representation of the command with arguments.
      Overrides:
      toString in class Object
      Since:
      May 25, 2010
      See Also: