Class SimEvent
java.lang.Object
simEngine.SimEvent
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Create an exact copy of this event.doubleGet the simulation time which this event was scheduled for.getData()Get the data passed in this event.intgetDest()Get the unique id number of the entity which is the destination of this event.intgetSrc()Get the unique id number of the entity which scheduled this event.intgetTag()Get the user-defined tag in this event.intGet the unique id number of the entity which scheduled this event.voidsetDest(int d) Set the destination entity of this event.voidsetSrc(int s) Set the source entity of this event.toString()Returns a string representation of the object.inttype()Get the user-defined tag in this event
-
Field Details
-
time
public double time
-
-
Constructor Details
-
SimEvent
public SimEvent()Constructor, create a blank event. Useful for fetching events using methods such asSimEntity.simWait(ev).
-
-
Method Details
-
getDest
public int getDest()Get the unique id number of the entity which is the destination of this event.- Returns:
- the id number
-
getSrc
public int getSrc()Get the unique id number of the entity which scheduled this event.- Returns:
- the id number
-
eventTime
public double eventTime()Get the simulation time which this event was scheduled for.- Returns:
- The simulation time
-
type
public int type()Get the user-defined tag in this event- Returns:
- The tag
-
scheduledBy
public int scheduledBy()Get the unique id number of the entity which scheduled this event.- Returns:
- the id number
-
getTag
public int getTag()Get the user-defined tag in this event.- Returns:
- The tag
-
getData
-
clone
-
setSrc
public void setSrc(int s) Set the source entity of this event.- Parameters:
s- The unique id number of the entity
-
setDest
public void setDest(int d) Set the destination entity of this event.- Parameters:
d- The unique id number of the entity
-
toString
Returns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The
toStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
-