public class CommandId
extends java.lang.Object
Command. This Id can be used to reference
the command later, such as when unsubscribing a subscription command.| Modifier and Type | Field and Description |
|---|---|
byte[] |
id |
| Constructor and Description |
|---|
CommandId(byte[] buffer)
Constructs a Command Id for an AMPS command, using an array of bytes as its identifier.
|
CommandId(byte[] buffer,
int position,
int length)
Constructs a Command Id for an AMPS command, using an array of bytes, a position number, and a length
as its identifier.
|
CommandId(java.lang.String string)
Constructs a CommandId for an AMPS command, using a string as its identifier.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Overridden to test equality based upon object class and the CommandId value.
|
int |
hashCode()
Overridden to return a hash code that is based upon CommandId value.
|
static CommandId |
nextIdentifier()
Returns the next Id for the current command.
|
void |
set(byte[] buffer,
int position,
int length)
Sets the CommandId for the AMPS command.
|
java.lang.String |
toString()
Overridden to return the CommandId value as a string where each byte is interpreted as an ISO-8859-1
character.
|
public CommandId(java.lang.String string)
string - A string used to set the new identifier for this AMPS command.public CommandId(byte[] buffer)
buffer - An array of bytes used to set the new identifier for this AMPS command.public CommandId(byte[] buffer,
int position,
int length)
buffer - An array of bytes used to set the new identifier for this AMPS command.position - An integer used to represent the position that the buffer should start.length - An integer used to determine the length of the new identifier.public static CommandId nextIdentifier()
public void set(byte[] buffer,
int position,
int length)
buffer - An array of bytes used to set the CommandId.length - Length of the new id.position - Position where the new CommandId should start.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object