|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.protocol.Statement
public class Statement
Constructor Summary | |
---|---|
Statement()
Creates a statement with no command or data. |
|
Statement(char[] bytes)
Creates a Statment from a byte array that contains both the command and optional data. |
|
Statement(char[] cmd,
char[] data)
Create a new statement object from separate command and data arrays. |
|
Statement(java.lang.String stmt)
Creates a Statment from a string that contains both the command and optional data. |
|
Statement(java.lang.String cmd,
java.lang.String data)
Create a new statement object from separate command and data strings. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compares two statements for equality. |
char[] |
getCmd()
Retrieve the cmd. |
char[] |
getData()
retrieve the data. |
static Statement |
getErrorStatement(java.lang.String data)
Creates a new ERROR message with the given error message. |
static Statement |
getOkStatement(java.lang.String data)
Creates a new OK message with the given payload. |
static Statement |
getStartStatement()
Creates a new Start message with the current Inca Protocol Version. |
static java.lang.String |
getVersion()
Returns the Inca protocol version. |
void |
setCmd(char[] cmd)
set the cmd. |
void |
setData(char[] data)
set the data. |
char[] |
toChars()
Converts the statement to bytes that can be sent across the wire. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Statement()
public Statement(char[] bytes)
bytes
- the raw bytespublic Statement(char[] cmd, char[] data)
cmd
- the characters that make up the commanddata
- the option characters that make up the datapublic Statement(java.lang.String stmt)
bytes
- the raw bytespublic Statement(java.lang.String cmd, java.lang.String data)
cmd
- the command stringdata
- the optional data stringMethod Detail |
---|
public char[] getCmd()
public void setCmd(char[] cmd)
cmd
- the raw characters for the commandpublic char[] getData()
public void setData(char[] data)
data
- raw characters for datapublic char[] toChars()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
other
-
public static Statement getErrorStatement(java.lang.String data)
s
- the error message
public static Statement getOkStatement(java.lang.String data)
public static Statement getStartStatement()
public static java.lang.String getVersion()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |