Class Event

java.lang.Object
simu.framework.Event
All Implemented Interfaces:
Comparable<Event>

public class Event extends Object implements 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 Details

    • Event

      public Event(IEventType type, double time)
      Constructs an Event with the specified event type and time.
      Parameters:
      type - the type of the event
      time - the time at which the event occurs
  • Method Details

    • setType

      public void setType(IEventType type)
      Sets the type of the event.
      Parameters:
      type - the type of the event
    • getType

      public IEventType getType()
      Returns the type of the event.
      Returns:
      the type of the event
    • 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

      public int compareTo(Event arg)
      Compares this event with the specified event based on the time.
      Specified by:
      compareTo in interface Comparable<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