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