|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elite.jdcbot.framework.DCIO
public class DCIO
Created on 26-May-08
The purpose of this class is to implement methods that are needed for IO easily send and recerive and parse commands.
Field Summary | |
---|---|
private java.lang.String |
ioexception_msg
|
Constructor Summary | |
---|---|
DCIO()
|
Method Summary | |
---|---|
java.lang.String |
parseCmdArgs(java.lang.String cmd)
Parses a raw command for the command's arguments, i.e. |
java.lang.String |
parseCmdName(java.lang.String cmd)
Parses a raw command for the command name. |
java.lang.String[] |
parseRawCmd(java.lang.String cmd)
Parses the given raw command and returns the command name in position 0 and the rest arguments in later slots. Note: This is a simple generalized parser. |
java.lang.String |
ReadCommand(java.io.InputStream in)
Reading raw command from in. |
java.lang.String |
ReadCommand(java.net.Socket socket)
|
void |
SendCommand(java.lang.String buffer,
java.io.OutputStream out)
Sends raw command to out. |
void |
SendCommand(java.lang.String buffer,
java.net.Socket socket)
|
void |
set_IOExceptionMsg(java.lang.String msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String ioexception_msg
Constructor Detail |
---|
public DCIO()
Method Detail |
---|
public void set_IOExceptionMsg(java.lang.String msg)
public final java.lang.String ReadCommand(java.io.InputStream in) throws java.lang.Exception
The
- socket stream from which to read the command.
java.lang.Exception
public final java.lang.String ReadCommand(java.net.Socket socket) throws java.lang.Exception
java.lang.Exception
public final void SendCommand(java.lang.String buffer, java.io.OutputStream out) throws java.lang.Exception
buffer
- Line which needs to be send. This method won't append "|" on the end on the string if it doesn't exist, so it is up to make
sure buffer ends with "|" if you calling this method.out
- The socket stream into which to write the raw command.
java.lang.Exception
public final void SendCommand(java.lang.String buffer, java.net.Socket socket) throws java.lang.Exception
java.lang.Exception
public final java.lang.String[] parseRawCmd(java.lang.String cmd)
cmd
- The raw command to parse.
public final java.lang.String parseCmdName(java.lang.String cmd)
cmd
- The raw command to parse.
public final java.lang.String parseCmdArgs(java.lang.String cmd)
cmd
- The raw command to parse.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |