FileDocCategorySizeDatePackage
BasicMessage.javaAPI DocExample801Tue Jan 20 21:08:18 GMT 1998dcj.examples.messageV1

BasicMessage.java

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();
}