Class Event

java.lang.Object
org.mpi_sws.jmc.strategies.trust.Event

public class Event extends Object
Represents an event object used by the algorithm.
  • Constructor Details

    • Event

      public Event(Long taskId, Integer location, Event.Type type)
      Creates a new event with the given task ID, location, and type.
      Parameters:
      taskId - The task ID.
      location - The location.
      type - The type.
  • Method Details

    • clone

      public Event clone()
      Creates a clone of the event.
      Overrides:
      clone in class Object
      Returns:
      A clone of the event.
    • toJson

      public com.google.gson.JsonElement toJson()
    • toJsonIgnoreLocation

      public com.google.gson.JsonElement toJsonIgnoreLocation()
    • getAttribute

      public <T> T getAttribute(String key)
      Returns the attribute of the event with the given key in the type T.
      Type Parameters:
      T - The type of the attribute.
      Parameters:
      key - The key of the attribute.
      Returns:
      The attribute with the given key.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • setAttribute

      public void setAttribute(String key, Object value)
      Sets the attribute of the event with the given key and value.
      Parameters:
      key - The key of the attribute.
      value - The value of the attribute.
    • key

      public Event.Key key()
      The key of the event.
      Returns:
      The key of the event.
    • getLocation

      public Integer getLocation()
      Returns the location of the event.
      Returns:
      The location of the event.
    • setLocation

      public void setLocation(Integer location)
    • getTaskId

      public Long getTaskId()
      Returns the task ID of the event.
      Returns:
      The task ID.
    • getType

      public Event.Type getType()
      Returns the type of the event.
      Returns:
      The type of the event.
    • getTimestamp

      public Integer getTimestamp()
      Returns the timestamp of the event.
      Returns:
      The timestamp of the event.
    • setTimestamp

      public void setTimestamp(Integer timestamp)
      Sets the timestamp of the event.
      Parameters:
      timestamp - The timestamp of the event.
    • getToStamp

      public Integer getToStamp()
      Returns the total order timestamp of the event.
      Returns:
      The total order timestamp of the event.
    • setToStamp

      public void setToStamp(Integer toStamp)
      Sets the total order timestamp of the event.
      Parameters:
      toStamp - The total order timestamp of the event.
    • init

      public static Event init()
      Creates an init event.
      Returns:
      An init event Event.
    • end

      public static Event end()
      Creates the bottom event to indicate end of the execution.
      Returns:
      An end event Event.
    • error

      public static Event error(String message)
      Creates a new error event with the given message.
      Parameters:
      message - The message of the error.
      Returns:
      An error event Event.
    • hasAttribute

      public boolean hasAttribute(String key)
    • isInit

      public boolean isInit()
      Returns true if the event is an init event.
      Returns:
      True if the event is an init event.
    • isRead

      public boolean isRead()
    • isWrite

      public boolean isWrite()
    • isReadEx

      public boolean isReadEx()
    • isWriteEx

      public boolean isWriteEx()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toVerboseString

      public String toVerboseString()
    • getKey

      public Event.Key getKey()