|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjas.events.SimEvent
public abstract class SimEvent
An abstract class that any event must override. It defines the necessary features for events.
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.
Constructor Summary | |
---|---|
SimEvent(java.lang.Object forObject)
Build an event pointing to an object target. |
Method Summary | |
---|---|
boolean |
canBeTrashed()
Return if event is trashable. |
int |
compareTo(java.lang.Object o)
Compare event on time. |
abstract void |
fireEvent()
Abstract method to be overridden by real implementation of SimEvent. |
int |
getLoop()
Get the loop length. |
long |
getTime()
Get the next firing absolute time. |
void |
setForObject(java.lang.Object o)
Recycle an event assigning new parameters to it. |
void |
setLoop(int newLoop)
Set the loop length. |
void |
setTime(long atTime)
Set the absolute time of event. |
void |
setTime(long atTime,
int withLoop)
Set the absolute time of event and its loop period. |
void |
setTimeAtNextLoop()
Schedule event at the next loop time. |
void |
setTrashable()
Set the trashable property. |
java.lang.String |
toString()
Return a string describing event. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimEvent(java.lang.Object forObject)
Method Detail |
---|
public boolean canBeTrashed()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public abstract void fireEvent()
public int getLoop()
public long getTime()
public void setForObject(java.lang.Object o)
public void setLoop(int newLoop)
public void setTime(long atTime)
public void setTime(long atTime, int withLoop)
public void setTimeAtNextLoop()
public void setTrashable()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |