jas.events
Class SimGroupEvent

java.lang.Object
  extended by jas.events.SimEvent
      extended by jas.events.SimGroupEvent
All Implemented Interfaces:
java.lang.Comparable

public class SimGroupEvent
extends SimEvent

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
SimGroupEvent()
          Build a new group event.
 
Method Summary
 void addCollectionEvent(java.util.Collection elements, java.lang.Class objectType, java.lang.String method)
          Create a new SimCollectionEvent and add an event to the list, using late binding method.
 void addCollectionEvent(java.util.Collection elements, int actionType)
          Create a new SimCollectionEvent and add an event to the list, using early binding method.
 void addEvent(java.lang.Object object, int actionType)
          Create a new SimSimpleEvent and add an event to the list, using early binding method.
 void addEvent(java.lang.Object object, java.lang.String method)
          Create a new SimSimpleEvent and add an event to the list, using late binding method.
 void addEvent(SimEvent newEvent)
          Add an event to the list.
 void addSystemEvent(int actionType)
          Create a new SimSystemEvent and add an event to the list.
 void clear()
          Empty the event list.
 void fireEvent()
          Fire each event into the list.
 SimEvent[] getEvents()
          Return an sorted array of the added events.
 void removeEvent(SimEvent event)
          Remove the given event from the list.
 
Methods inherited from class jas.events.SimEvent
canBeTrashed, compareTo, getLoop, getTime, setForObject, setLoop, setTime, setTime, setTimeAtNextLoop, setTrashable, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimGroupEvent

public SimGroupEvent()
Build a new group event.

Method Detail

addCollectionEvent

public void addCollectionEvent(java.util.Collection elements,
                               java.lang.Class objectType,
                               java.lang.String method)
Create a new SimCollectionEvent and add an event to the list, using late binding method.


addCollectionEvent

public void addCollectionEvent(java.util.Collection elements,
                               int actionType)
Create a new SimCollectionEvent and add an event to the list, using early binding method.


addEvent

public void addEvent(java.lang.Object object,
                     int actionType)
Create a new SimSimpleEvent and add an event to the list, using early binding method.


addEvent

public void addEvent(java.lang.Object object,
                     java.lang.String method)
Create a new SimSimpleEvent and add an event to the list, using late binding method.


addEvent

public void addEvent(SimEvent newEvent)
Add an event to the list.


addSystemEvent

public void addSystemEvent(int actionType)
Create a new SimSystemEvent and add an event to the list.


clear

public void clear()
Empty the event list.


fireEvent

public void fireEvent()
Fire each event into the list.

Specified by:
fireEvent in class SimEvent

getEvents

public SimEvent[] getEvents()
Return an sorted array of the added events.

Returns:
An array of SimEvent objects.

removeEvent

public void removeEvent(SimEvent event)
Remove the given event from the list.