Package microsim.event
Class EventGroup
java.lang.Object
microsim.event.Event
microsim.event.EventGroup
- All Implemented Interfaces:
Comparable<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
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCollectionEvent(Collection<?> elements, Class<?> objectType, String method) addCollectionEvent(Collection<?> elements, Class<?> objectType, String method, boolean readOnly) Create a new SimCollectionEvent and add an event to the list, using late binding method.addCollectionEvent(Collection<?> elements, Enum<?> actionType) addCollectionEvent(Collection<?> elements, Enum<?> actionType, boolean readOnly) Create a new SimCollectionEvent and add an event to the list, using early binding method.Create a new SimSimpleEvent and add an event to the list, using early binding method.Create a new SimSimpleEvent and add an event to the list, using late binding method.Add an event to the list.addSystemEvent(SimulationEngine engine, SystemEventType actionType) Create a new SimSystemEvent and add an event to the list.voidclear()Empty the event list.Event[]Return an sorted array of the added events.voidFire each event into the list.voidremoveEvent(Event event) Remove the given event from the list.Methods inherited from class microsim.event.Event
compareTo, getLoop, getOrdering, getTime, setTimeAtNextLoop, setTimeOrderingAndLoopPeriod
-
Constructor Details
-
EventGroup
public EventGroup()Build a new group event.
-
-
Method Details
-
clear
public void clear()Empty the event list. -
addEvent
Add an event to the list. -
addEvent
Create a new SimSimpleEvent and add an event to the list, using late binding method.- Throws:
SimulationException
-
addEvent
Create a new SimSimpleEvent and add an event to the list, using early binding method. -
addSystemEvent
Create a new SimSystemEvent and add an event to the list. -
addCollectionEvent
public EventGroup addCollectionEvent(Collection<?> elements, Class<?> objectType, String method) throws SimulationException - Throws:
SimulationException
-
addCollectionEvent
public EventGroup addCollectionEvent(Collection<?> elements, Class<?> objectType, String method, boolean readOnly) throws SimulationException Create a new SimCollectionEvent and add an event to the list, using late binding method.- Throws:
SimulationException
-
addCollectionEvent
-
addCollectionEvent
Create a new SimCollectionEvent and add an event to the list, using early binding method. -
removeEvent
Remove the given event from the list. -
fireEvent
Fire each event into the list.- Specified by:
fireEventin classEvent- Throws:
SimulationException
-
eventsToArray
Return an sorted array of the added events.- Returns:
- An array of SimEvent objects.
-
getActions
-