|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Decorator
A Decorator
represents a computational component that can
modify or "decorate" a Graph
.
The method #decorateGraph(Graph)
is called once for each
Decorator
instance during the creation of the canonical
Graph
(see
Model.getCanonicalGraph(org.eclipse.emf.common.util.URI)
).
Typically, this method would add additional DynamicLabel
s to the
Graph
under construction. For example, a disease model would be
implemented as a Decorator
and it would add
DynamicLabel
s to the Node
s of the Graph
that
represent the state of the disease at each Node
.
After the canonical Graph
is created, the method
#updateLabels(Graph, STEMTime, long)
will be called once every time
the Scenario
is "stepped" (see Scenario.step()
). The
DynamicLabel
s that it updates are those that were added to the
Graph
in the #decorateGraph(Graph)
method call. A reference
to each of those DynamicLabel
s is kept in a collection (see
getLabelsToUpdate()
) maintained by the Decorator
.
The #updateLabels(Graph, STEMTime, long)
method computes the "next"
value of all of the DynamicLabel
s in that collection.
For maximum flexibility, the nature of that LabelValue
and its
computation are not defined or restricted. For instance, the
Decorator
could compute the LabelValue
from the
contents of the Graph
, read the value from a file, obtain it from a
real-time datasource such as a weather station or something accessible from a
web site or a web service.
Method Summary | |
---|---|
void |
decorateGraph()
Augment the graph by adding components ( Edges , Node s,
Label s). |
Graph |
getGraph()
|
org.eclipse.emf.common.util.EList<DynamicLabel> |
getLabelsToUpdate()
|
void |
resetLabels()
Process each of the DynamicLabels that this
decorator is responsible for and reset their "current"
value to be the initial value assigned during the call to the method
decorateGraph() |
void |
setGraph(Graph value)
Sets the value of the ' Graph ' container reference. |
void |
updateLabels(STEMTime time,
long timerPeriod)
Process each of the DynamicLabel s that this
Decorator is responsible for and determine their "next"
value. |
Methods inherited from interface org.eclipse.ohf.stem.core.common.Identifiable |
---|
getDublinCore, getTypeURI, getURI, sane, setDublinCore, setTypeURI, setURI |
Methods inherited from interface org.eclipse.emf.ecore.EObject |
---|
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset |
Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
---|
eAdapters, eDeliver, eNotify, eSetDeliver |
Method Detail |
---|
Graph getGraph()
Graph
that the Decorator
decorates.void setGraph(Graph value)
Graph
' container reference.
value
- the new value of the 'Graph' container reference.getGraph()
org.eclipse.emf.common.util.EList<DynamicLabel> getLabelsToUpdate()
DynamicLabel
s that this Decorator
is responsible for updating.void decorateGraph()
Edges
, Node
s,
Label
s). The added components, in particular
DynamicLabel
s, can be modified later during a call to
#updateLabels(Graph, STEMTime)
. A side effect of this call is
that it adds the decorator to the collection maintained by the
Graph
.
void updateLabels(STEMTime time, long timerPeriod)
DynamicLabel
s that this
Decorator
is responsible for and determine their "next"
value.
time
- the time to be used when determining the changes to be made to
the GraphtimePeriod
- the number of milliseconds difference between the time and the
previous time value.void resetLabels()
DynamicLabels
that this
decorator
is responsible for and reset their "current"
value to be the initial value assigned during the call to the method
decorateGraph()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |