public class NativeBasicSimEntity extends BasicSimEntity
An attmept to use NSS Objects driven by the Simkit engine. The idea is to use native methods to do the callbacks for processSimEvent() and handleSimEvent(). Since the state will typically be maintained outside Simkit, a native run() method is called for in order to perform whatever initializations are required.
The header file simkit_nss_NativeBasicSimEntity.h can be generated by the call
javah simkit.nss.NativeBasicSimEntityfrom the command line, where the current working directory is one level above the simkit folder.
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
NativeBasicSimEntity() |
NativeBasicSimEntity(Priority priority) |
NativeBasicSimEntity(java.lang.String name) |
NativeBasicSimEntity(java.lang.String name,
Priority priority) |
Modifier and Type | Method and Description |
---|---|
void |
handleSimEvent(SimEvent simEvent)
This method is called from Schedule and will only
be passed SimEvents it had originally scheduled.
|
void |
processSimEvent(SimEvent simEvent)
This callback is received by listening to another SimEntity
|
void |
reset()
Perform whatever initializations are required.
|
addPropertyChangeListener, addPropertyChangeListener, attemptSchedule, clearAddedProperty, compareTo, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAddedProperties, getEventList, getEventListID, getName, getPriority, getPropertiesString, getProperty, getProperty, getPropertyChangeListeners, getSerial, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, isClearAddedPropertiesOnReset, isJustDefinedProperties, isPersistant, isReRunnable, isVerbose, parametersMatch, removePropertyChangeListener, removePropertyChangeListener, resetNextSerial, setClearAddedPropertiesOnReset, setEventList, setEventListID, setJustDefinedProperties, setName, setPersistant, setPriority, setProperty, setVerbose, toString, waitDelay, waitDelay, waitDelay, waitDelay
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
public NativeBasicSimEntity()
public NativeBasicSimEntity(java.lang.String name)
name
- The name of the NativeBasicSimEntity createdpublic NativeBasicSimEntity(Priority priority)
priority
- The priority of the NativeBasicSimEntity instancepublic NativeBasicSimEntity(java.lang.String name, Priority priority)
name
- The name of the NativeBasicSimEntitypriority
- The priority of the NativeBasicSimEntitypublic void reset()
reset
in interface ReRunnable
reset
in class BasicSimEntity
public void handleSimEvent(SimEvent simEvent)
handleSimEvent
in interface SimEventScheduler
handleSimEvent
in class BasicSimEntity
simEvent
- The SimEvent instance.public void processSimEvent(SimEvent simEvent)
processSimEvent
in interface SimEventListener
processSimEvent
in class BasicSimEntity
simEvent
- The SimEvent being passed