|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
public class BrahmsObjectCtx
The BrahmsObjectCtx class defines the base class for all contexts in the Brahms system as part of the dynamic model. The BrahmsObject context class manages the start and end times of the contexts or depending on the type of object the creation and deletion time of an object. Every context allows for additional notes to capture additional information for explanation purposes. The contexts in the dynamic model are generally used to maintain the state information for the elements defined in a Brahms model in a simulation or when running intelligent agents.
Field Summary |
---|
Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants |
---|
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, DETECTABLE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE |
Constructor Summary | |
---|---|
BrahmsObjectCtx()
Constructor, creates a new context that has no relationship with a BrahmsObject. |
|
BrahmsObjectCtx(BrahmsObject obj)
Constructor, creates a new context for the specified BrahmsObject. |
Method Summary | |
---|---|
void |
addNote(Note note)
Adds a note to the context. |
BrahmsObject |
getContextFor()
Returns the BrahmsObject this context is a context for. |
long |
getEndTime()
Returns the end time. |
java.lang.String |
getID()
Returns the unique identifier for the context. |
Note |
getNote(int index)
Returns the note defined at the given index. |
java.util.Enumeration |
getNotes()
Returns a list of all the notes for the context. |
long |
getStartTime()
Returns the start time. |
void |
removeNote(Note note)
Removes a note from the context. |
void |
setContextFor(BrahmsObject obj)
Sets the BrahmsObject for which this context is a context. |
void |
setEndTime(long endTime)
Sets the end time. |
void |
setID(java.lang.String id)
Sets a unique identifier for the context. |
void |
setStartTime(long startTime)
Sets the start time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrahmsObjectCtx()
public BrahmsObjectCtx(BrahmsObject obj)
obj
- the BrahmsObject for which to create a contextMethod Detail |
---|
public void setID(java.lang.String id)
setID
in interface IBrahmsObjectCtx
id
- the unique identifier for the contextpublic java.lang.String getID()
getID
in interface IBrahmsObjectCtx
public void setStartTime(long startTime) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
setStartTime
in interface IBrahmsObjectCtx
startTime
- the time the object was started or created.
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if the start time is <= 0public long getStartTime()
getStartTime
in interface IBrahmsObjectCtx
public void setEndTime(long endTime) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
setEndTime
in interface IBrahmsObjectCtx
endTime
- the time the object was ended or deleted.
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if the end time is <= 0 && end time < start timepublic long getEndTime()
getEndTime
in interface IBrahmsObjectCtx
public void addNote(Note note) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
addNote
in interface IBrahmsObjectCtx
note
- the Note to be added to the context.
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if note is nullpublic void removeNote(Note note) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
removeNote
in interface IBrahmsObjectCtx
note
- the Note to be removed from the context
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if note is null, no notes present or note not presentpublic java.util.Enumeration getNotes() throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getNotes
in interface IBrahmsObjectCtx
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if no notes are presentpublic Note getNote(int index) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getNote
in interface IBrahmsObjectCtx
index
- the index of the requested Note
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if no notes are registered
or an invalid index is given.public void setContextFor(BrahmsObject obj)
obj
- the BrahmsObject for which this context is a contextpublic BrahmsObject getContextFor() throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getContextFor
in interface IBrahmsObjectCtx
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if no BrahmsObject is defined for the context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |