|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectm865.simulation.Event
public abstract class Event
Abstract class for an event. It defines the basic methods for any event in a discrete event simulation.
Field Summary | |
---|---|
protected java.lang.Integer |
firingTime
Every event has a time at which it fires |
Constructor Summary | |
---|---|
Event(java.lang.Integer firingTime)
Constructor for an event |
Method Summary | |
---|---|
boolean |
adjustPriority(java.lang.Comparable obj)
A prioritizable object can have its priority raised or lowered. |
int |
compareTo(java.lang.Object obj)
The compareTo method required by the Comparable interface If the priorities are comparable this returns an int specifying the relation between the two priorities. |
abstract void |
fire()
This method is invoked when it is time for an event to fire. |
java.lang.Integer |
getFiringTime()
Gets the firing time for this event. |
void |
setFiringTime(java.lang.Integer newTime)
Set a new firing time for this event. |
java.lang.String |
toString()
The basic toString method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Integer firingTime
Constructor Detail |
---|
public Event(java.lang.Integer firingTime)
firingTime
- the time at which this event is scheduled to fire.Method Detail |
---|
public java.lang.Integer getFiringTime()
public void setFiringTime(java.lang.Integer newTime)
newTime
- the new time for this event to fire.public abstract void fire()
public boolean adjustPriority(java.lang.Comparable obj)
adjustPriority
in interface Prioritizeable
obj
- a Comparable object appropriate for specifying the
priority. This method will throw a ClassCastException if the new
priority is not an Integer.
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- the specified object which should be a PrioritizedItem
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |