public class Event implements Comparable {
   static final int STOP = 0;
   static final int MSG_ARRIVAL = 1;
   static final int MSG_SENT = 2;
   private int who; // Who did it
   private int what; // What they did
   private double when; // When they did it

   public Event(int ID, int type,
                double time) {
      who = ID;
      what = type;
      when = time;
   }

   public int getWho( ) {return who;}
   public int getWhat( ) {return what;}
   public double getWhen( ) {return when;}

   public int compareTo (Object rhs)
              throws ClassCastException{
      double rhsTime = ((Event)rhs).getWhen();
      return when < rhsTime ? -1:
             rhsTime < when ? 1: 0;
   }

   public String toString(){
        return "[Who:" + who + ", What:" + what + ", When:" + when +"]";
    }

}

