java.lang.Object
org.bzdev.devqsim.SimulationEvent
org.bzdev.devqsim.TaskQueueSimEvent<T>
- All Implemented Interfaces:
Comparable<SimulationEvent>
Simulation event for task queues.
This class represents the elements that will be stored on a TaskQueue's
internal queue.
The parameter T is the class for arguments used to pass
data associated with a task (e.g., the time to wait before the
task is activated once it reaches the head of the queue. It
should match the parameter used for the matching TaskQueue.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel()
Cancel an event.boolean
Check if an event was canceled.protected void
Process an event.Methods inherited from class org.bzdev.devqsim.SimulationEvent
compareTo, getSource, getStackTraceArray, getTime, isPending, setStackTraceArray
-
Method Details
-
cancel
public boolean cancel()Description copied from class:SimulationEvent
Cancel an event. The default behavior is to deschedule the event from the simulation's event queue. Subclasses should perform any additional processing and also call super.cancel() or deschedule the event explicitly.- Overrides:
cancel
in classSimulationEvent
- Returns:
- true if the event could be canceled; false otherwise
-
isCanceled
public boolean isCanceled()Description copied from class:SimulationEvent
Check if an event was canceled.- Overrides:
isCanceled
in classSimulationEvent
- Returns:
- true if the current event was canceled; false otherwise
-
processEvent
protected void processEvent()Description copied from class:SimulationEvent
Process an event. This method will be invoked by the simulation scheduler when the event should occur. Subclasses must implement it if any processing is to occur.- Specified by:
processEvent
in classSimulationEvent
-