Class CollectionTargetEvent

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

public class CollectionTargetEvent extends Event
It is able to inform all elements within a collection about an event.

Title: JAS

Description: Java Agent-based Simulation library

Copyright (C) 2002 Michele Sonnessa

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Author:
Michele Sonnessa
  • Field Details

    • eventType

      protected Enum<?> eventType
    • readOnly

      protected boolean readOnly
    • collection

      protected Collection<?> collection
  • Constructor Details

    • CollectionTargetEvent

      public CollectionTargetEvent(Collection<?> elements, Class<?> objectType, String method, boolean readOnly) throws SimulationException
      Create a collection event using late binding method call.
      Throws:
      SimulationException
    • CollectionTargetEvent

      public CollectionTargetEvent(Collection<?> elements, Enum<?> actionType, boolean readOnly)
      Create a collection event using early binding method call.
  • Method Details

    • setForObject

      public void setForObject(Collection<?> elements, Class<?> objectType, String method, boolean readOnly) throws SimulationException
      Recycling method. See SimEvent for more details.
      Throws:
      SimulationException
    • setForObject

      public void setForObject(Collection<?> elements, Enum<?> actionType, boolean readOnly)
      Recycling method. See SimEvent for more details.
    • fireEvent

      public void fireEvent()
      Fire the event, calling each element contained into the collection.
      Specified by:
      fireEvent in class Event