Package org.mpi_sws.jmc.strategies.trust
Class Event
java.lang.Object
org.mpi_sws.jmc.strategies.trust.Event
Represents an event object used by the algorithm.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA generic event predicate.static classUnique key for the event.static enumRepresents the type of the event according to the algorithm. -
Constructor Summary
ConstructorsConstructorDescriptionEvent(Long taskId, Integer location, Event.Type type) Creates a new event with the given task ID, location, and type. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a clone of the event.static Eventend()Creates the bottom event to indicate end of the execution.booleanstatic EventCreates a new error event with the given message.<T> TgetAttribute(String key) Returns the attribute of the event with the given key in the type T.getKey()Returns the location of the event.Returns the task ID of the event.Returns the timestamp of the event.Returns the total order timestamp of the event.getType()Returns the type of the event.booleanhasAttribute(String key) static Eventinit()Creates an init event.booleanisInit()Returns true if the event is an init event.booleanisRead()booleanisReadEx()booleanisWrite()booleankey()The key of the event.voidsetAttribute(String key, Object value) Sets the attribute of the event with the given key and value.voidsetLocation(Integer location) voidsetTimestamp(Integer timestamp) Sets the timestamp of the event.voidsetToStamp(Integer toStamp) Sets the total order timestamp of the event.com.google.gson.JsonElementtoJson()com.google.gson.JsonElementtoString()
-
Constructor Details
-
Event
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
Creates a clone of the event. -
toJson
public com.google.gson.JsonElement toJson() -
toJsonIgnoreLocation
public com.google.gson.JsonElement toJsonIgnoreLocation() -
getAttribute
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
-
setAttribute
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
The key of the event.- Returns:
- The key of the event.
-
getLocation
Returns the location of the event.- Returns:
- The location of the event.
-
setLocation
-
getTaskId
Returns the task ID of the event.- Returns:
- The task ID.
-
getType
Returns the type of the event.- Returns:
- The type of the event.
-
getTimestamp
Returns the timestamp of the event.- Returns:
- The timestamp of the event.
-
setTimestamp
Sets the timestamp of the event.- Parameters:
timestamp- The timestamp of the event.
-
getToStamp
Returns the total order timestamp of the event.- Returns:
- The total order timestamp of the event.
-
setToStamp
Sets the total order timestamp of the event.- Parameters:
toStamp- The total order timestamp of the event.
-
init
Creates an init event.- Returns:
- An init event
Event.
-
end
Creates the bottom event to indicate end of the execution.- Returns:
- An end event
Event.
-
error
Creates a new error event with the given message.- Parameters:
message- The message of the error.- Returns:
- An error event
Event.
-
hasAttribute
-
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
-
toVerboseString
-
getKey
-