org.sbml.jsbml
public class Event extends AbstractNamedSBaseWithUnit implements UniqueNamedSBase
Events were
introduced to SBML in Level 2, this class must not be used for models in
Level 1.| Modifier and Type | Field and Description |
|---|---|
private Delay |
delay
Represents the delay sub-element of an event element.
|
private boolean |
isSetUseValuesFromTriggerTime |
private ListOf<EventAssignment> |
listOfEventAssignments
Represents the listOfEventAssignments sub-element of an event element.
|
private Priority |
priority
Represents the priority sub-element of an event.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
private Trigger |
trigger
Represents the trigger sub-element of an event element.
|
private java.lang.Boolean |
useValuesFromTriggerTime
Represents the 'useValuesFromTriggerTime' XML attribute of an event
element.
|
unitsIDignoredExtensions, ignoredXMLElements, lvlistOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS| Constructor and Description |
|---|
Event()
Creates an Event instance.
|
Event(Event event)
Creates an Event instance from a given event.
|
Event(int level,
int version)
Creates an Event from a level and version.
|
Event(java.lang.String id) |
Event(java.lang.String id,
int level,
int version)
Creates an Event instance from an id, level and version.
|
Event(java.lang.String id,
java.lang.String name,
int level,
int version)
Creates an Event instance from an id, name, level and version.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEventAssignment(EventAssignment eventass)
Adds a new
EventAssignment to the listOfEventAssignments. |
void |
clearListOfEventAssignments()
Remove all the EventAssignments of the listOfEventAssignments of this
Event.
|
Event |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
boolean |
containsUndeclaredUnits()
Deprecated.
|
Delay |
createDelay()
|
Delay |
createDelay(ASTNode math)
|
EventAssignment |
createEventAssignment()
Creates a new
EventAssignment element and adds it to the ListOfEventAssignments list. |
EventAssignment |
createEventAssignment(java.lang.String variable,
ASTNode math)
Creates a new
EventAssignment element and adds it to the ListOfEventAssignments list. |
EventAssignment |
createEventAssignment(Variable variable,
ASTNode math)
Creates a new
EventAssignment element and adds it to the ListOfEventAssignments list. |
Priority |
createPriority()
|
Priority |
createPriority(ASTNode math)
|
Trigger |
createTrigger()
|
Trigger |
createTrigger(boolean initialValue,
boolean persistent)
|
Trigger |
createTrigger(boolean initialValue,
boolean persistent,
ASTNode math)
|
boolean |
equals(java.lang.Object object)
|
boolean |
getAllowsChildren() |
javax.swing.tree.TreeNode |
getChildAt(int index) |
int |
getChildCount() |
Delay |
getDelay() |
UnitDefinition |
getDerivedUnitDefinition()
Deprecated.
|
java.lang.String |
getDerivedUnits()
Deprecated.
|
EventAssignment |
getEventAssignment(int n)
Gets an element from the listOfEventAssignments at the given index.
|
EventAssignment |
getEventAssignment(java.lang.String eventAssignmentId)
Gets an element from the listOfEventAssignments, with the given id.
|
int |
getEventAssignmentCount()
Returns the number of
EventAssignments in this Event. |
ListOf<EventAssignment> |
getListOfEventAssignments()
Returns the listOfEventAssignments.
|
int |
getNumEventAssignments()
Returns the number of
EventAssignments in this Event. |
ListOf<Event> |
getParent()
This is equivalent to calling
AbstractSBase.getParentSBMLObject(), but this
method is needed for TreeNode. |
java.lang.String |
getPredefinedUnitID()
Returns the predefined unit identifier for this data type with the
current level/version combination.
|
Priority |
getPriority() |
java.lang.String |
getTimeUnits()
Deprecated.
|
java.lang.String |
getTimeUnitsID()
Deprecated.
|
UnitDefinition |
getTimeUnitsInstance()
Deprecated.
|
Trigger |
getTrigger() |
java.lang.String |
getUnits()
Deprecated.
|
UnitDefinition |
getUnitsInstance()
Deprecated.
|
boolean |
getUseValuesFromTriggerTime() |
int |
hashCode()
Returns a hash code value for this
SBase instance. |
void |
initDefaults()
Initializes the default values using the current Level/Version configuration.
|
void |
initDefaults(int level,
int version)
Initializes the default values of this
Event. |
boolean |
isIdMandatory()
This method can be used to query if the identifier of this
NamedSBase is required to be defined (i.e., not null)
in the definition of SBML. |
boolean |
isSetDelay() |
boolean |
isSetListOfEventAssignments()
Returns
true, if listOfEventAssignments contains at least one element. |
boolean |
isSetPriority() |
boolean |
isSetTimeUnits()
Deprecated.
|
boolean |
isSetTimeUnitsInstance()
Deprecated.
|
boolean |
isSetTrigger() |
boolean |
isSetUnits()
Deprecated.
|
boolean |
isSetUnitsInstance()
Deprecated.
|
boolean |
isSetUseValuesFromTriggerTime() |
boolean |
isUseValuesFromTriggerTime() |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the given attribute in this
SBase. |
boolean |
removeEventAssignment(EventAssignment eventAssignment)
Removes an element from the listOfEventAssignments.
|
EventAssignment |
removeEventAssignment(int i)
Removes an element from the listOfEventAssignments at the given index.
|
EventAssignment |
removeEventAssignment(java.lang.String id)
Removes an element from the listOfEventAssignments.
|
void |
setDelay(Delay delay)
Sets the delay of this Event to 'delay'.
|
void |
setListOfEventAssignments(ListOf<EventAssignment> listOfEventAssignments)
Sets the given
ListOf<EventAssignment>. |
void |
setPriority(Priority priority) |
void |
setTimeUnits(java.lang.String timeUnits)
Deprecated.
This is only applicable for SBML Level 2, Versions 1 and 2.
|
void |
setTimeUnits(UnitDefinition timeUnits)
Deprecated.
|
void |
setTimeUnitsID(java.lang.String timeUnitsID)
Deprecated.
|
void |
setTrigger(Trigger trigger)
Sets the trigger of this Event to 'trigger'.
|
void |
setUnits(java.lang.String timeUnits)
Deprecated.
|
void |
setUnits(Unit.Kind timeUnitKind)
Deprecated.
|
void |
setUnits(Unit timeUnit)
Deprecated.
|
void |
setUnits(UnitDefinition timeUnits)
Deprecated.
|
void |
setUseValuesFromTriggerTime(boolean useValuesFromTriggerTime)
Sets the useValuesFromTriggerTime of this
Event to
'useValuesFromTriggerTime'. |
boolean |
unsetDelay()
Sets the delay of this
Event to null. |
boolean |
unsetListOfEventAssignments()
Removes the
listOfEventAssignments from this Event and
notifies all registered instances of TreeNodeChangeListener. |
boolean |
unsetPriority()
|
void |
unsetTimeUnits()
Sets the timeUnitsID of this
Event to null. |
boolean |
unsetTrigger()
Sets the trigger of this
Event to null and notifies
TreeNodeChangeListeners. |
void |
unsetUseValuesFromTriggerTime()
Sets the useValuesFromTriggerTime of this Event to
null. |
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes()
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
isPredefinedUnitsID, unsetUnitscheckIdentifier, getId, getName, isSetId, isSetName, isValidId, setId, setName, toString, unsetId, unsetNameaddCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTermaddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySetfinalize, getClass, notify, notifyAll, wait, wait, waitgetId, getName, isSetId, isSetName, setId, setName, unsetId, unsetNameaddCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTermaddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySetprivate static final long serialVersionUID
private Delay delay
private boolean isSetUseValuesFromTriggerTime
private ListOf<EventAssignment> listOfEventAssignments
private Priority priority
private Trigger trigger
private java.lang.Boolean useValuesFromTriggerTime
public Event()
null.public Event(Event event)
event - public Event(int level,
int version)
listOfEventAssignments and timeUnitsID are null.level - version - public Event(java.lang.String id)
id - public Event(java.lang.String id,
int level,
int version)
null.id - level - version - public Event(java.lang.String id,
java.lang.String name,
int level,
int version)
null.id - name - level - version - public boolean addEventAssignment(EventAssignment eventass)
EventAssignment to the listOfEventAssignments.
The listOfEventAssignments is initialized if necessary.
eventass - the element to add to the listtrue if the listOfEventAssignments was
changed as a result of this call.public void clearListOfEventAssignments()
public Event clone()
SBaseSBase with the same properties
like this one.clone in interface SBaseclone in class AbstractNamedSBaseWithUnit@Deprecated public boolean containsUndeclaredUnits()
SBaseWithDerivedUnittrue or false depending on whether this
SBaseWithDerivedUnit refers to elements such as parameters or
numbers with undeclared units.
A return value of true indicates that the UnitDefinition
returned by SBaseWithDerivedUnit.getDerivedUnitDefinition() may not accurately
represent the units of the expression.containsUndeclaredUnits in interface SBaseWithDerivedUnitcontainsUndeclaredUnits in class AbstractNamedSBaseWithUnittrue if the math expression of this SBaseWithDerivedUnit
includes parameters/numbers with undeclared units,
false otherwise.public EventAssignment createEventAssignment()
EventAssignment element and adds it to the ListOfEventAssignments list.EventAssignment instance.public EventAssignment createEventAssignment(java.lang.String variable, ASTNode math)
EventAssignment element and adds it to the ListOfEventAssignments list.variable - the target of the new EventAssignmentmath - the math expression for the new EventAssignmentEventAssignment instance.public EventAssignment createEventAssignment(Variable variable, ASTNode math)
EventAssignment element and adds it to the ListOfEventAssignments list.variable - the target of the new EventAssignmentmath - the math expression for the new EventAssignmentEventAssignment instance.public Trigger createTrigger(boolean initialValue, boolean persistent)
initialValue - persistent - Trigger instance.public boolean equals(java.lang.Object object)
SBasepublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodegetAllowsChildren in class AbstractSBasepublic javax.swing.tree.TreeNode getChildAt(int index)
getChildAt in interface javax.swing.tree.TreeNodegetChildAt in class AbstractSBasepublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodegetChildCount in class AbstractSBasepublic Delay getDelay()
@Deprecated public UnitDefinition getDerivedUnitDefinition()
SBaseWithDerivedUnitUnitDefinition within the corresponding Model.
If no equivalent unit definition can be found, a new unit definition will
be created that is not part of the model but represents the unit of this
quantity. If it is not possible to derive a unit for this quantity, null
will be returned.getDerivedUnitDefinition in interface SBaseWithDerivedUnitgetDerivedUnitDefinition in class AbstractNamedSBaseWithUnitUnitDefinition that represent the derived unit of this quantity, or null
if it is not possible to derive a unit.@Deprecated public java.lang.String getDerivedUnits()
SBaseWithDerivedUnitUnit.Kind this
method will return the String representation of this
Unit.Kind.getDerivedUnits in interface SBaseWithDerivedUnitgetDerivedUnits in class AbstractNamedSBaseWithUnitString that represent the id of a UnitDefinition. This UnitDefinition
represent the derived unit of this quantity. If it is not possible to derive a unit for this quantity
or if no equivalent UnitDefinition can be found in the Model, null is returned.public EventAssignment getEventAssignment(int n)
n - the index of the EventAssignment element to get.java.lang.IndexOutOfBoundsException - if the listOf is not set or
if the index is out of bound (index < 0 || index > list.size).public EventAssignment getEventAssignment(java.lang.String eventAssignmentId)
eventAssignmentId - the id of the EventAssignment element to get.public ListOf<EventAssignment> getListOfEventAssignments()
public int getNumEventAssignments()
EventAssignments in this Event.EventAssignments in this Event.public int getEventAssignmentCount()
EventAssignments in this Event.EventAssignments in this Event.public ListOf<Event> getParent()
AbstractSBaseAbstractSBase.getParentSBMLObject(), but this
method is needed for TreeNode.getParent in interface javax.swing.tree.TreeNodegetParent in class AbstractSBaseAbstractSBase.getParentSBMLObject()public java.lang.String getPredefinedUnitID()
AbstractNamedSBaseWithUnitgetPredefinedUnitID in class AbstractNamedSBaseWithUnitModel. This can
be one of the predefined unit identifiers if there are any.public Priority getPriority()
@Deprecated public java.lang.String getTimeUnits()
@Deprecated public java.lang.String getTimeUnitsID()
@Deprecated public UnitDefinition getTimeUnitsInstance()
UnitDefinition instance of the model which matches
the timesUnitsID of this Event.UnitDefinition instance of the model which matches
the timesUnitsID of this Event. Returns null if there is
no UnitDefinition id which matches the value of the
timeUnits attribute of this Event.public Trigger getTrigger()
@Deprecated public java.lang.String getUnits()
getUnits in interface SBaseWithUnitgetUnits in class AbstractNamedSBaseWithUnitSBaseWithUnit. The empty
String if it is not set.@Deprecated public UnitDefinition getUnitsInstance()
getUnitsInstance in interface SBaseWithUnitgetUnitsInstance in class AbstractNamedSBaseWithUnitUnitDefinition instance which has the unitsID of
this SBaseWithUnit as id. Null if it doesn't
exist. In case that the unit of this SBaseWithUnit
represents a base Unit, a new UnitDefinition will
be created and returned by this method. This new
UnitDefinition will only contain the one unit represented
by the unit identifier in this SBaseWithUnit. Note
that the corresponding model will not contain this
UnitDefinition. The identifier of this new
UnitDefinition will be set to the same value as the name
of the base Unit.public boolean getUseValuesFromTriggerTime()
public int hashCode()
SBaseSBase instance.hashCode in interface SBasehashCode in class AbstractNamedSBaseWithUnitSBase instance.Object.hashCode()public void initDefaults()
public void initDefaults(int level,
int version)
Event.public boolean isIdMandatory()
NamedSBaseNamedSBase is required to be defined (i.e., not null)
in the definition of SBML.isIdMandatory in interface NamedSBasetrue if the identifier of this element must be set in
order to create a valid SBML representation. false
otherwise, i.e., if the identifier can be understood as an optional
attribute.public boolean isSetDelay()
true if the delay of this Event is not null.public boolean isSetListOfEventAssignments()
true, if listOfEventAssignments contains at least one element.true if the listOfEventAssignments of this Event is not
null and not empty;public boolean isSetPriority()
@Deprecated public boolean isSetTimeUnits()
true if the timeUnitsID of this Event is not null.@Deprecated public boolean isSetTimeUnitsInstance()
true if the UnitDefinition which has the timeUnitsID of this
Event as id is not null.public boolean isSetTrigger()
true if the trigger of this Event is not null.@Deprecated public boolean isSetUnits()
isSetUnits in interface SBaseWithUnitisSetUnits in class AbstractNamedSBaseWithUnittrue if the unitsID of this element is not null.@Deprecated public boolean isSetUnitsInstance()
SBaseWithUnitunitsID
attribute of this SBaseWithUnit is either an existing base
Unit, i.e., a simple Unit that can directly be addressed
via its Unit.Kind element, or the identifier of an existing
UnitDefinition in the Model to which this
SBaseWithUnit belongs.isSetUnitsInstance in interface SBaseWithUnitisSetUnitsInstance in class AbstractNamedSBaseWithUnittrue if either a UnitDefinition, which has the
unitsID of this SBaseWithUnit, can be
found in the Model to which this
SBaseWithUnit belongs, or if this element's
unitsID as a corresponding base Unit for the
given Level/Version combination.public boolean isSetUseValuesFromTriggerTime()
true is the useValuesFromTriggerTime of this Event is not null.public boolean isUseValuesFromTriggerTime()
Event
if it has been set, false otherwise.public boolean readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
SBaseSBase.
If the given attribute name is not recognized, nothing is done and
false is returned.
readAttribute in interface SBasereadAttribute in class AbstractNamedSBaseattributeName - localName of the XML attributeprefix - prefix of the XML attributevalue - value of the XML attributetrue if the attribute has been successfully read.public EventAssignment removeEventAssignment(int i)
i - the index where to remove the EventAssignment.java.lang.IndexOutOfBoundsException - if the listOf is not set or
if the index is out of bound (index < 0 || index > list.size).public EventAssignment removeEventAssignment(java.lang.String id)
id - the id of the element to be removed from the list.public boolean removeEventAssignment(EventAssignment eventAssignment)
eventAssignment - the element to be removed from the list.List.remove(Object)public void setDelay(Delay delay)
delay - public void setListOfEventAssignments(ListOf<EventAssignment> listOfEventAssignments)
ListOf<EventAssignment>. If listOfEventAssignments
was defined before and contains some elements, they are all unset.listOfEventAssignments - public void setPriority(Priority priority)
priority - the priority to setPropertyNotAvailableException - if Level < 3.@Deprecated public void setTimeUnits(java.lang.String timeUnits)
Event to 'timeUnits'.timeUnits - @Deprecated public void setTimeUnits(UnitDefinition timeUnits)
Event to the id of the UnitDefinition
'timeUnits'.timeUnits - @Deprecated public void setTimeUnitsID(java.lang.String timeUnitsID)
timeUnitsID - the timeUnitsID to setpublic void setTrigger(Trigger trigger)
Trigger parentSBML object to this Event instance.trigger - @Deprecated public void setUnits(Unit.Kind timeUnitKind)
SBaseWithUnitSBaseWithUnit.
A new unit will be created base on this kind.setUnits in interface SBaseWithUnitsetUnits in class AbstractNamedSBaseWithUnit@Deprecated public void setUnits(java.lang.String timeUnits)
SBaseWithUnitSBaseWithUnit. Only valid unit
kind names or identifiers of already existing UnitDefinitions are
allowed arguments of this function.setUnits in interface SBaseWithUnitsetUnits in class AbstractNamedSBaseWithUnittimeUnits - the identifier of an already existing UnitDefinition
or an Unit.Kind identifier for the current
level/version combination of this unit. Passing a null value
to this method is equivalent to calling SBaseWithUnit.unsetUnits().@Deprecated public void setUnits(Unit timeUnit)
SBaseWithUnitUnit of this SBaseWithUnit.setUnits in interface SBaseWithUnitsetUnits in class AbstractNamedSBaseWithUnit@Deprecated public void setUnits(UnitDefinition timeUnits)
SBaseWithUnitSBaseWithUnit to the given
unit definition.setUnits in interface SBaseWithUnitsetUnits in class AbstractNamedSBaseWithUnitpublic void setUseValuesFromTriggerTime(boolean useValuesFromTriggerTime)
Event to
'useValuesFromTriggerTime'.useValuesFromTriggerTime - PropertyNotAvailableException - if the Level/Version combination is lower than 2.4.public boolean unsetDelay()
Event to null.public boolean unsetListOfEventAssignments()
listOfEventAssignments from this Event and
notifies all registered instances of TreeNodeChangeListener.true if calling this method lead to a change in this
data structure.public boolean unsetPriority()
public void unsetTimeUnits()
Event to null.public boolean unsetTrigger()
Event to null and notifies
TreeNodeChangeListeners.public void unsetUseValuesFromTriggerTime()
null.public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBaseSBase that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes in interface SBasewriteXMLAttributes in class AbstractNamedSBaseMap containing the XML attributes of this object.