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 TypeMethodDescriptionbooleancancel()Cancel an event.booleanCheck if an event was canceled.protected voidProcess 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:SimulationEventCancel 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:
cancelin classSimulationEvent- Returns:
- true if the event could be canceled; false otherwise
-
isCanceled
public boolean isCanceled()Description copied from class:SimulationEventCheck if an event was canceled.- Overrides:
isCanceledin classSimulationEvent- Returns:
- true if the current event was canceled; false otherwise
-
processEvent
protected void processEvent()Description copied from class:SimulationEventProcess 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:
processEventin classSimulationEvent
-