Methods Summary |
---|
public boolean | Do() return false;
|
public void | addArg(java.lang.Object arg)
argList.addElement(arg);
|
public java.util.Vector | argList()
Vector listCopy = (Vector)argList.clone();
return listCopy;
|
public java.lang.Object | getArg(int idx)
Object arg = null;
if (idx < argList.size()) {
arg = argList.elementAt(idx);
}
return arg;
|
public boolean | handles(java.lang.String msgId) return false;
|
public java.lang.String | messageID()
return id;
|
public Message | newCopy() return new Message(id);
|
public boolean | readArgs(java.io.InputStream ins)
boolean success = true;
DataInputStream din = new DataInputStream(ins);
// Read tokens until the "end-of-message" token is seen.
try {
String token = din.readUTF();
while (token.compareTo(endToken) != 0) {
addArg(token);
token = din.readUTF();
}
}
catch (IOException e) {
// Failed to read complete argument list.
success = false;
}
return success;
|
public void | setId(java.lang.String mid)
id = mid;
|
public boolean | writeArgs(java.io.OutputStream outs)
int len = argList.size();
boolean success = true;
DataOutputStream dout = new DataOutputStream(outs);
// Write each argument in order
try {
for (int i = 0; i < len; i++) {
String arg = (String)argList.elementAt(i);
dout.writeUTF(arg);
}
// Finish with the end-of-message token
dout.writeUTF(endToken);
}
catch (IOException e) {
success = false;
}
return success;
|