Package xal.smf.impl
Class WireScanner.CmdPck
java.lang.Object
xal.smf.impl.WireScanner.CmdPck
- Enclosing class:
- WireScanner
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 Summary
ConstructorsConstructorDescriptionCmdPck(WireScanner.CMD cmd) Create a newCmdobject for the givenCMDand no arguments.CmdPck(WireScanner.CMD cmd, Number... args) Create a newCmdobject for the givenCMDand given arguments.CmdPck(WireScanner.CMD cmd, WireScanner.CMDARG arg, Number... addargs) Create a newCmdobject for the givenand the givenWireScanner.CMDargment and any addition arguments addargs.WireScanner.CMDARG -
Method Summary
Modifier and TypeMethodDescriptionReturns the argument of this command.getArgument(int index) Return the command argument at the given index.intReturn the number of arguments in this command.Returns the command constant of this command instance, that is, an element of the enumerationCMD.toString()Returns a string representation of the command with arguments.
-
Constructor Details
-
CmdPck
Create a newCmdobject for the givenCMDand no arguments.- Parameters:
cmd- the wire scanner command- Since:
- May 21, 2010
-
CmdPck
Create a newCmdobject for the givenCMDand given arguments.- Parameters:
cmd- the wire scanner commandargs- the arguments of the command (may be empty)- Since:
- May 21, 2010
-
CmdPck
Create a newCmdobject for the givenand the givenWireScanner.CMDargment and any addition arguments addargs.WireScanner.CMDARG- Parameters:
cmd- the wire scanner commandarg- pre-defined command argumentaddargs- 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
Returns the command constant of this command instance, that is, an element of the enumerationCMD.- Returns:
- Command code enumeration for this command
- Since:
- May 21, 2010
-
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
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
Returns a string representation of the command with arguments.
-