Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.squawk.debugger
Class CommandPacket

    java.lang.Object
      com.sun.squawk.debugger.Packet
          com.sun.squawk.debugger.CommandPacket

    public final class CommandPacket

extends Packet

A `CommandPacket` encapsulates a JDWP command packet.

Field Summary

Fields inherited from class com.sun.squawk.debugger.Packet
`FLAG_NEEDS_REPLY, FLAG_REPLY`

Constructor Summary
`CommandPacket(int set, int command, boolean needsReply)` Creates a packet to send a new command packet.
`CommandPacket(int id, int dataLength, DataInputStream data, int set, int command, boolean needsReply)` Creates a packet to encapsulate a received JDWP command packet.

Method Summary
`int` | `command()`
`ReplyPacket` | `createReply(int errorCode)` Creates a packet to send a reply for this command.
`int` | `getFlags()` Gets the value for the 'flags' field in the header of this packet.
`ReplyPacket` | `getReply()` Gets the reply to this sent command packet.
`boolean` | `needsReply()`
`int` | `set()`
`String` | `toString()` Returns a string representation of the object.
`static String` | `toString(int set, int command)` Gets the identifier for a given JDWP command.
`protected void` | `writeFields(DataOutputStream dos)` Write the `set` and `command` fields to `dos`

Methods inherited from class com.sun.squawk.debugger.Packet
`appendData, getID, getInputStream, getOutputStream, getSize, write`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### CommandPacket

    public CommandPacket(int set,
                         int command,
                         boolean needsReply)

  Creates a packet to send a new command packet.

  Parameters:
    `owner` - the owner of the new packet
    `set` - the JDWP command set constant
    `command` - the JDWP command constant

### CommandPacket

    public CommandPacket(int id,
                         int dataLength,
                         DataInputStream data,
                         int set,
                         int command,
                         boolean needsReply)
                  throws IOException

  Creates a packet to encapsulate a received JDWP command packet.

  Parameters:
    `owner` - the JDWPListener that received the packet
    `id` - the identifier in the command packet
    `dataLength` - the length of the data to read from `data`
    `data` - the contents of the data field of the packet
    `set` - the JDWP command set constant
    `command` - the JDWP command constant
  Throws:
    `IOException`

Method Detail

### set

    public int set()

  Returns:
    the JDWP command set identifier of this command.

### command

    public int command()

  Returns:
    the JDWP command identifier of this command.

### createReply

    public ReplyPacket createReply(int errorCode)

  Creates a packet to send a reply for this command.

  Parameters:
    `errorCode` - the JDWP error code to return in the reply
  Returns:
    the reply packet

### needsReply

    public final boolean needsReply()

### getFlags

    public int getFlags()

  Gets the value for the 'flags' field in the header of this packet.

  Specified by:
    `getFlags` in class `Packet`

### getReply

    public ReplyPacket getReply()

  Gets the reply to this sent command packet.

  Returns:
    the reply or null if it has not yet been received

### writeFields

    protected void writeFields(DataOutputStream dos)
                        throws IOException

  Write the `set` and `command` fields to `dos`

  Specified by:
    `writeFields` in class `Packet`
  Parameters:
    `dos` - DataOutputStream
  Throws:
    `IOException`

### toString

    public static String toString(int set,
                                  int command)

  Gets the identifier for a given JDWP command.

  Parameters:
    `set` - a command set
    `command` - a command with `set`
  See Also:
    JDWP

### toString

    public String toString()

  Returns a string representation of the object. In general, the `toString` method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

  The `toString` method for class `Object` returns a string consisting of the name of the class of which the object is an instance, the at-sign character ``@`', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

  >      getClass().getName() + '@' + Integer.toHexString(hashCode())

  Specified by:
    `toString` in class `Packet`
  Returns:
    a string representation of the object.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"