Class CollectionTargetEvent

java.lang.Object
microsim.event.Event
microsim.event.CollectionTargetEvent
All Implemented Interfaces:
Comparable<Event>

public class CollectionTargetEvent extends Event
This class informs all elements within a collection about Event.
  • Field Details

    • eventType

      protected Enum<?> eventType
    • readOnly

      protected boolean readOnly
    • collection

      protected Collection<?> 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 of CollectionTargetEvent type using late binding method call (type detection happens at run-time).
      Parameters:
      elements - A collection of elements of some nature.
      objectType - The type of elements.
      method - The method name.
      readOnly - A boolean flag that makes elements an immutable object.
      Throws:
      SimulationException - when there is no such method to invoke.
      NullPointerException - when any of the objects passed to the constructor is null.
    • CollectionTargetEvent

      public CollectionTargetEvent(@NonNull @NonNull Collection<?> elements, @NonNull @NonNull Enum<?> actionType, boolean readOnly)
      Creates an object of CollectionTargetEvent type with the method Creates an object of CollectionTargetEvent 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 makes elements an immutable object.
      Throws:
      NullPointerException - when any of the objects passed to the constructor is null.
  • Method Details

    • fireEvent

      public void fireEvent()
      Fires a particular event, i.e., calls each element contained into the collection.
      Specified by:
      fireEvent in class Event