jist.runtime
Class Event

java.lang.Object
  extended by jist.runtime.Event
Direct Known Subclasses:
EventLocation

public class Event
extends java.lang.Object

Stores the details of an entity invocation for processing at the appropriate simulation time.

Since:
JIST1.0
Version:
$Id: Event.java,v 1.34 2004/07/27 15:46:47 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
static class Event.Continuation
          Stores a continuation information for blocking event calls.
static class Event.ContinuationFrame
          Stores a single stack frame for event calls with continuation.
static class Event.EventComparator
          Comparator used to compare two events in terms of their timestamp.
 
Field Summary
 java.lang.Object[] args
          Arguments to be passed to entity method for processing.
 Event.Continuation cont
          Any event continuation information.
 java.lang.reflect.Method method
          Method to be invoked for event processing.
 EntityRef ref
          Reference to entity that will receive the event.
 long time
          Simulation time at which the event should be processed.
 
Constructor Summary
Event()
          Simulation event empty constructor, used for pooling.
Event(Event ev)
          Copy constructor.
Event(long time, java.lang.reflect.Method method, EntityRef ref, java.lang.Object[] args)
          Simulation event constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Test object equality.
 java.lang.String getArgsString()
          Return event arguments as string
 java.lang.String getClassString()
          Return event target class as string.
 java.lang.String getContinuationString()
          Return event continuation contents.
 java.lang.String getEntityString()
          Return event target entity as string.
 java.lang.String getMethodString()
          Return event target method as string.
 java.lang.String getModifiersString()
          Return event target method modifiers as string. public, abstract and final are not interesting.
 java.lang.String getTimeString()
          Return event time as string
 java.lang.String getTypeString()
          Return event type as string.
 int hashCode()
          Return entity reference hashcode.
 void set(long time, java.lang.reflect.Method method, EntityRef ref, java.lang.Object[] args)
          Simulation event assignment, used for pooling.
 java.lang.String toString()
          Return string representation of Event.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

time

public long time
Simulation time at which the event should be processed.


ref

public EntityRef ref
Reference to entity that will receive the event.


method

public java.lang.reflect.Method method
Method to be invoked for event processing.


args

public java.lang.Object[] args
Arguments to be passed to entity method for processing.


cont

public Event.Continuation cont
Any event continuation information. Used only for continuation calls and callbacks - blocking events.

Constructor Detail

Event

public Event()
Simulation event empty constructor, used for pooling.


Event

public Event(long time,
             java.lang.reflect.Method method,
             EntityRef ref,
             java.lang.Object[] args)
Simulation event constructor.

Parameters:
time - simulation time at which the event should be processed
method - method to be invoked for event processing
ref - entity reference to receive event
args - arguments to be passed to entity for processing

Event

public Event(Event ev)
Copy constructor.

Parameters:
ev - event to copy
Method Detail

set

public void set(long time,
                java.lang.reflect.Method method,
                EntityRef ref,
                java.lang.Object[] args)
Simulation event assignment, used for pooling.

Parameters:
time - simulation time at which the event should be processed
method - method to be invoked for event processing
ref - entity reference to receive event
args - arguments to be passed to entity for processing

getTypeString

public java.lang.String getTypeString()
Return event type as string.

Returns:
event type string

getTimeString

public java.lang.String getTimeString()
Return event time as string

Returns:
event time as string

getModifiersString

public java.lang.String getModifiersString()
Return event target method modifiers as string. public, abstract and final are not interesting. Return only whether method is static or not.

Returns:
event modifiers as string

getClassString

public java.lang.String getClassString()
Return event target class as string. Note that the unqualified class name is returned.

Returns:
unqualified event target class name.

getMethodString

public java.lang.String getMethodString()
Return event target method as string.

Returns:
event target method name.

getArgsString

public java.lang.String getArgsString()
Return event arguments as string

Returns:
comma-separated event arguments as string

getContinuationString

public java.lang.String getContinuationString()
Return event continuation contents. Note that only a summary of continuation information is returned.

Returns:
summary of event continuation payload

getEntityString

public java.lang.String getEntityString()
Return event target entity as string.

Returns:
event target entity as string.

toString

public java.lang.String toString()
Return string representation of Event.

Overrides:
toString in class java.lang.Object
Returns:
string representation

equals

public boolean equals(java.lang.Object o)
Test object equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - object to perform equality test
Returns:
whether object is equal to event

hashCode

public int hashCode()
Return entity reference hashcode.

Overrides:
hashCode in class java.lang.Object
Returns:
entity reference hashcode