|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.engineering.eventdriven.AbsEntity
public abstract class AbsEntity
The abstract superclass of all Entity classes. Entity objects are what the state engine tracks through the state models in response to events. The action methods associated with states are also defined in the Entity - this may seem strange but in practice the state code almost always manipulates Entity data, so making the methods members of the Entity class removes the need to cast the entity references in every state action. Entities are created by calling
Engine.createEntity(). An
entity can delete itself from the system at the end of its lifecycle by
calling delete() in the termination state method.
| Field Summary | |
|---|---|
protected org.jscience.engineering.eventdriven.State |
currentState
The current state of the entity (references a State object in the state model). |
protected java.lang.String |
id
Identifier of the entity. |
protected Engine |
ownerEngine
The state engine within which this entity exists. |
protected Model |
ownerModel
The state model that the entity is associated with. |
| Constructor Summary | |
|---|---|
AbsEntity()
|
|
| Method Summary | |
|---|---|
protected void |
delete()
Deletes this entity from the state engine (usually called from the termination state code in the state model). |
protected void |
generateEvent(AbsEntity entity,
org.jscience.engineering.eventdriven.EventSpec eventSpec,
java.lang.Object[] args)
Generate a normal event. |
protected void |
generateEvent(AbsEntity entity,
java.lang.String eventSpecId,
java.lang.Object[] args)
Generate a normal event. |
protected void |
generateEvent(java.lang.String entityId,
java.lang.String eventSpecId,
java.lang.Object[] args)
Generate a normal event. |
protected void |
generateInternalEvent(org.jscience.engineering.eventdriven.EventSpec eventSpec,
java.lang.Object[] args)
Generate an internal event. |
protected void |
generateInternalEvent(java.lang.String eventSpecId)
Generate an internal event with no arguments. |
protected void |
generateInternalEvent(java.lang.String eventSpecId,
java.lang.Object[] args)
Generate an internal event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String id
protected org.jscience.engineering.eventdriven.State currentState
protected Engine ownerEngine
protected Model ownerModel
| Constructor Detail |
|---|
public AbsEntity()
| Method Detail |
|---|
protected final void delete()
protected final void generateEvent(AbsEntity entity,
org.jscience.engineering.eventdriven.EventSpec eventSpec,
java.lang.Object[] args)
throws StateProcessingException
entity - The target entity.eventSpec - The event type specifier.args - The arguments to the target state code.
StateProcessingException - if any arguments are null.
protected final void generateEvent(AbsEntity entity,
java.lang.String eventSpecId,
java.lang.Object[] args)
throws StateProcessingException
entity - The target entity.eventSpecId - The name of the event type specifier.args - The arguments to the target state code.
StateProcessingException - if any arguments are null
or the event spec name is not recognized.
protected final void generateEvent(java.lang.String entityId,
java.lang.String eventSpecId,
java.lang.Object[] args)
throws StateProcessingException
entityId - The target entity id.eventSpecId - The name of the event type specifier.args - The arguments to the target state code.
StateProcessingException - if any arguments are null
or the entity or event spec name is not recognized..
protected final void generateInternalEvent(java.lang.String eventSpecId,
java.lang.Object[] args)
throws StateProcessingException
eventSpecId - The name of the event type specifier.args - The arguments to the target state code.
StateProcessingException - if any arguments are null
or the event spec name is not recognized.
protected final void generateInternalEvent(java.lang.String eventSpecId)
throws StateProcessingException
eventSpecId - The name of the event type specifier.
StateProcessingException - if any arguments are null
or the event spec name is not recognized.
protected final void generateInternalEvent(org.jscience.engineering.eventdriven.EventSpec eventSpec,
java.lang.Object[] args)
throws StateProcessingException
eventSpec - The event type specifier.args - The arguments to the target state code.
StateProcessingException - if any arguments are null
or the event spec name is not recognized.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||