|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgps.event.SimEvent
public class SimEvent
the base class of all events in simulator. events includes simulator internal events, protocol events, and user action events.
| Field Summary | |
|---|---|
static int |
SIM_AGENT_ACTIVE
activate an agent |
static int |
SIM_AGENT_DEACTIVE
deactivate an agent |
static int |
SIM_END
end simulation event |
static int |
SIM_NODE_ACTIVE
activate a node |
static int |
SIM_NODE_DEACTIVE
deactivate a node |
static int |
SIM_START
start simulation event, don't have to be explicitely triggered |
| Constructor Summary | |
|---|---|
SimEvent()
don't do anything, just for complete |
|
SimEvent(double timeStamp,
int type,
java.util.ArrayList handlerList,
java.lang.Object obj)
constructs a new event with a list of handler |
|
SimEvent(double timeStamp,
int type,
SimEventHandler handler,
java.lang.Object obj)
constructs a new event with one handler |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object event)
compare the order of two events |
void |
dispatch()
dispatchs the event to it's handler |
java.lang.String |
format(java.lang.String ss)
generate a formated string with basic event information and additional information provided by parameter |
java.lang.Object |
getAddParam()
gets the second param for the event |
long |
getEventID()
gets the unique id for this event |
java.lang.Object |
getParam()
gets first param for the event |
double |
getTimeStamp()
gets the timestamp of the event |
int |
getType()
gets event type |
void |
setAddParam(java.lang.Object obj)
sets the second param for the event |
void |
setEventID()
sets next available unique id for this event |
void |
setTimeStamp(double t)
sets timestamp |
void |
setType(int type)
sets event type |
java.lang.String |
toString()
generates a string representation of the event |
java.lang.String |
typeString(int type)
generates a String description of the type |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SIM_START
public static final int SIM_END
public static final int SIM_NODE_ACTIVE
public static final int SIM_NODE_DEACTIVE
public static final int SIM_AGENT_ACTIVE
public static final int SIM_AGENT_DEACTIVE
| Constructor Detail |
|---|
public SimEvent()
public SimEvent(double timeStamp,
int type,
SimEventHandler handler,
java.lang.Object obj)
timeStamp - the time this event to be triggeredtype - the event typeobj - the paramater for this eventhandler - the handler for this event
public SimEvent(double timeStamp,
int type,
java.util.ArrayList handlerList,
java.lang.Object obj)
timeStamp - the time this event to be triggeredtype - the event typeobj - the paramater for this eventhandlerList - the handler for this event| Method Detail |
|---|
public long getEventID()
public void setEventID()
public void dispatch()
public double getTimeStamp()
public void setTimeStamp(double t)
t - new timestamppublic java.lang.Object getParam()
public void setAddParam(java.lang.Object obj)
obj - the object to be included int the event as the second parameterpublic java.lang.Object getAddParam()
public int compareTo(java.lang.Object event)
compareTo in interface java.lang.Comparableevent - the events to be compared topublic int getType()
public void setType(int type)
type - the new event typepublic java.lang.String typeString(int type)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String format(java.lang.String ss)
ss - the additional information to be included in the formated string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||