input
Class ExternalEvent

java.lang.Object
  extended by input.ExternalEvent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ExternalEvent>
Direct Known Subclasses:
ConnectionEvent, MessageEvent

public class ExternalEvent
extends java.lang.Object
implements java.lang.Comparable<ExternalEvent>, java.io.Serializable

Super class for all external events. All new classes of external events must extend this class. This can also be used as a dummy event if only an update request (and no further actions) to all hosts is needed.

See Also:
Serialized Form

Field Summary
protected  double time
          Time of the event (simulated seconds)
 
Constructor Summary
ExternalEvent(double time)
           
 
Method Summary
 int compareTo(ExternalEvent other)
          Compares two external events by their time.
 double getTime()
          Returns the time when this event should happen.
 void processEvent(World world)
          Processes the external event.
 java.lang.String toString()
          Returns a String representation of the event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

time

protected double time
Time of the event (simulated seconds)

Constructor Detail

ExternalEvent

public ExternalEvent(double time)
Method Detail

processEvent

public void processEvent(World world)
Processes the external event.

Parameters:
world - World where the actors of the event are

getTime

public double getTime()
Returns the time when this event should happen.

Returns:
Event's time

compareTo

public int compareTo(ExternalEvent other)
Compares two external events by their time.

Specified by:
compareTo in interface java.lang.Comparable<ExternalEvent>
Parameters:
other - The other external event
Returns:
-1, zero, 1 if this event happens before, at the same time, or after the other event

toString

public java.lang.String toString()
Returns a String representation of the event

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the event