Package microsim.event
Class CollectionTargetEvent
java.lang.Object
microsim.event.Event
microsim.event.CollectionTargetEvent
- All Implemented Interfaces:
Comparable<Event>
This class informs all elements within a collection about
Event
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionCollectionTargetEvent
(@NonNull Collection<?> elements, @NonNull Class<?> objectType, @NonNull String method, boolean readOnly) Creates an object ofCollectionTargetEvent
type using late binding method call (type detection happens at run-time).CollectionTargetEvent
(@NonNull Collection<?> elements, @NonNull Enum<?> actionType, boolean readOnly) Creates an object ofCollectionTargetEvent
type with the method Creates an object ofCollectionTargetEvent
type using early binding method call (all types are set during the process of compilation). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Fires a particular event, i.e., calls each element contained into the collection.Methods inherited from class microsim.event.Event
compareTo, setTimeAtNextLoop, setTimeOrderingAndLoopPeriod
-
Field Details
-
eventType
-
readOnly
protected boolean readOnly -
collection
-
-
Constructor Details
-
CollectionTargetEvent
public CollectionTargetEvent(@NonNull @NonNull Collection<?> elements, @NonNull @NonNull Class<?> objectType, @NonNull @NonNull String method, boolean readOnly) throws SimulationException Creates an object ofCollectionTargetEvent
type using late binding method call (type detection happens at run-time).- Parameters:
elements
- A collection of elements of some nature.objectType
- The type ofelements
.method
- The method name.readOnly
- A boolean flag that makeselements
an immutable object.- Throws:
SimulationException
- when there is no such method to invoke.NullPointerException
- when any of the objects passed to the constructor isnull
.
-
CollectionTargetEvent
public CollectionTargetEvent(@NonNull @NonNull Collection<?> elements, @NonNull @NonNull Enum<?> actionType, boolean readOnly) Creates an object ofCollectionTargetEvent
type with the method Creates an object ofCollectionTargetEvent
type using early binding method call (all types are set during the process of compilation).- Parameters:
elements
- A collection of elements of some nature.actionType
- An action to invoke.readOnly
- A boolean flag that makeselements
an immutable object.- Throws:
NullPointerException
- when any of the objects passed to the constructor isnull
.
-
-
Method Details