Class EventGroup

  • All Implemented Interfaces:
    java.lang.Comparable<Event>

    public class EventGroup
    extends Event
    A special implementation of the SimEvent familiy. It is not a real event, but a container for other events. When fired this object automatically fires the events contained. Each contained event is fired at the group time, any other time pointer is ignored.

    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

    • Constructor Detail

      • EventGroup

        public EventGroup()
        Build a new group event.
    • Method Detail

      • clear

        public void clear()
        Empty the event list.
      • addEvent

        public EventGroup addEvent​(Event newEvent)
        Add an event to the list.
      • addEvent

        public EventGroup addEvent​(java.lang.Object object,
                                   java.lang.Enum<?> actionType)
        Create a new SimSimpleEvent and add an event to the list, using early binding method.
      • addCollectionEvent

        public EventGroup addCollectionEvent​(java.util.Collection<?> elements,
                                             java.lang.Class<?> objectType,
                                             java.lang.String method,
                                             boolean readOnly)
                                      throws SimulationException
        Create a new SimCollectionEvent and add an event to the list, using late binding method.
        Throws:
        SimulationException
      • addCollectionEvent

        public EventGroup addCollectionEvent​(java.util.Collection<?> elements,
                                             java.lang.Enum<?> actionType)
      • addCollectionEvent

        public EventGroup addCollectionEvent​(java.util.Collection<?> elements,
                                             java.lang.Enum<?> actionType,
                                             boolean readOnly)
        Create a new SimCollectionEvent and add an event to the list, using early binding method.
      • removeEvent

        public void removeEvent​(Event event)
        Remove the given event from the list.
      • eventsToArray

        public Event[] eventsToArray()
        Return an sorted array of the added events.
        Returns:
        An array of SimEvent objects.
      • getActions

        public java.util.List<Event> getActions()