package dcj.examples.messageV1;
import java.util.Vector;
/**
* Source code from "Java Distributed Computing", by Jim Farley.
*
* Class: BasicMessage
* Example: 6-1
* Description: A simple message class.
*/
public abstract class BasicMessage
{
protected String id;
protected Vector argList;
public BasicMessage() {
argList = new Vector();
}
public BasicMessage(String mid) {
id = mid;
argList = new Vector();
}
protected void setId(String mid) {
id = mid;
}
public void addArg(String arg) {
argList.addElement(arg);
}
public String messageID() {
return id;
}
public Vector argList() {
Vector listCopy = (Vector)argList.clone();
return listCopy;
}
public abstract boolean Do();
}
|