|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.krep.evalbench.comm.Connection
public abstract class Connection
Abstract superclass for connection protocols that use input and output streams.
Constructor Summary | |
---|---|
Connection()
|
Method Summary | |
---|---|
protected abstract InputStreamReader |
getInput()
Retrieves the input stream for this connection. |
protected abstract OutputStream |
getOutput()
Retrieves the output stream for this connection. |
String |
hark(int n)
Harks to incoming data. |
String |
receive(char exit)
Tries to receive a sequence of characters until an exit character is read. |
String |
receive(int n)
Tries to receive a fixed number of characters. |
LinkedList<Integer> |
receiveByte(int n)
Tries to receive a fixed number of characters. |
void |
send(byte data)
Sends data to the target. |
void |
send(byte[] data)
Sends data to the target. |
void |
send(String data)
Sends data to the target. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.cau.cs.kieler.krep.evalbench.comm.IConnection |
---|
dispose |
Constructor Detail |
---|
public Connection()
Method Detail |
---|
protected abstract InputStreamReader getInput()
null
if no input stream is availableprotected abstract OutputStream getOutput()
null
if no output stream is availablepublic String receive(char exit) throws CommunicationException
receive
in interface IConnection
exit
- the exit character
CommunicationException
- when a timeout is reached before the exit character is readpublic String receive(int n) throws CommunicationException
receive
in interface IConnection
n
- the number of characters to be fetched
CommunicationException
- when a timeout is reached before the exit character is readpublic LinkedList<Integer> receiveByte(int n) throws CommunicationException
receiveByte
in interface IConnection
n
- the number of characters to be fetched
CommunicationException
- when a timeout is reached before the exit character is readpublic String hark(int n) throws CommunicationException
hark
in interface IConnection
n
- maximal number of characters to receive
CommunicationException
- when an exception occurs while receiving datapublic void send(String data) throws CommunicationException
send
in interface IConnection
data
- data to be sent
CommunicationException
- when an exception occurs while sending datapublic void send(byte data) throws CommunicationException
send
in interface IConnection
data
- data to be sent
CommunicationException
- when an exception occurs while sending datapublic void send(byte[] data) throws CommunicationException
send
in interface IConnection
data
- data to be sent
CommunicationException
- when an exception occurs while sending data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |