public static class WireScanner.CmdPck
extends java.lang.Object
WireScanner.CMD
instance to form a
complete command.Constructor and Description |
---|
CmdPck(WireScanner.CMD cmd)
Create a new
Cmd object for
the given CMD and no
arguments. |
CmdPck(WireScanner.CMD cmd,
java.lang.Number... args)
Create a new
Cmd object for
the given CMD and given
arguments. |
CmdPck(WireScanner.CMD cmd,
WireScanner.CMDARG arg,
java.lang.Number... addargs)
Create a new
Cmd object for the
given and the given
argment and any addition
arguments addargs. |
Modifier and Type | Method and Description |
---|---|
java.lang.Number |
getArgument()
Returns the argument of this command.
|
java.lang.Number |
getArgument(int index)
Return the command argument at the given index.
|
int |
getArgumentCount()
Return the number of arguments in this command.
|
WireScanner.CMD |
getCommand()
Returns the command constant of this
command instance, that is, an element of
the enumeration
CMD . |
java.lang.String |
toString()
Returns a string representation of the command with arguments.
|
public CmdPck(WireScanner.CMD cmd)
Cmd
object for
the given CMD
and no
arguments.cmd
- the wire scanner commandpublic CmdPck(WireScanner.CMD cmd, java.lang.Number... args)
Cmd
object for
the given CMD
and given
arguments.cmd
- the wire scanner commandargs
- the arguments of the command (may be empty)public CmdPck(WireScanner.CMD cmd, WireScanner.CMDARG arg, java.lang.Number... addargs)
Cmd
object for the
given WireScanner.CMD
and the given
WireScanner.CMDARG
argment and any addition
arguments addargs.cmd
- the wire scanner commandarg
- pre-defined command argumentaddargs
- additional arguments of the command (may be empty)public int getArgumentCount()
public WireScanner.CMD getCommand()
CMD
.public java.lang.Number getArgument()
getArgument(int)
public java.lang.Number getArgument(int index) throws java.lang.IllegalArgumentException
index
- the command argument indexjava.lang.IllegalArgumentException
- the given index is too large for the
number of arguments in this commandpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()