Class Event
java.lang.Object
simu.framework.Event
- All Implemented Interfaces:
Comparable<Event>
The Event class represents an event in the simulation.
It contains the event type and the time at which the event occurs.
-
Constructor Summary
ConstructorsConstructorDescriptionEvent(IEventType type, double time) Constructs an Event with the specified event type and time. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this event with the specified event based on the time.doublegetTime()Returns the time at which the event occurs.getType()Returns the type of the event.voidsetTime(double time) Sets the time at which the event occurs.voidsetType(IEventType type) Sets the type of the event.
-
Constructor Details
-
Event
Constructs an Event with the specified event type and time.- Parameters:
type- the type of the eventtime- the time at which the event occurs
-
-
Method Details
-
setType
Sets the type of the event.- Parameters:
type- the type of the event
-
getType
-
setTime
public void setTime(double time) Sets the time at which the event occurs.- Parameters:
time- the time at which the event occurs
-
getTime
public double getTime()Returns the time at which the event occurs.- Returns:
- the time at which the event occurs
-
compareTo
Compares this event with the specified event based on the time.- Specified by:
compareToin interfaceComparable<Event>- Parameters:
arg- the event to compare with- Returns:
- -1 if this event occurs before the specified event, 1 if it occurs after, and 0 if they occur at the same time
-