|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.graph.hierarchy.Hierarchy
mapss.dif.DIFHierarchy
public class DIFHierarchy
DIFHierarchy class.
DIFHierarchy class extends Hierarchy
. It
overrides the methods in Hierarchy
to limit the associated graph
to be DIFGraph
. It also overrides mirror(boolean)
to mirror a
DIFHierarchy including all graph topologies, interface ports, element weights,
DIFAttributes, and DIFParameters.
Ports in DIFHierarchy can have attributes like edges and nodes in DIFGraph.
Ports cannot contain weights because they are not elements in graphs.
The DIFHierarchy provides the AttributeContainer
to store the
attributes of Ports.
DIF utilizes edge weights to record the production rate and consumption rate of the source node and sink node of that edge. No edge will be built between a nod and its associated port. In this situation, DIF specifies the production rate and consumption rate as port attributes. Therefore, "production" and "consumption" attributes are reserved for ports in this purpose. Because ports do not have weights to further distinguish between different types of weights (ex: CSDF, BCSDF, SDF, HSDF), users need to be very careful about assigning the "production" and "consumption" attributes. The specific data type for the production and consumption rate of each dataflow model can be found in xxxEdgeWeight. xxxLanguageAnalysis will also take the responsibility to check the production and consumption rate for edges and ports.
Override method Hierarchy.flatten(Node)
to support DIFAttribute references problem after flatten and update
production and consumption attributes of ports to the flattened edges.
mirror()
method can completely clone/mirror
the DIFHierarchy/DIFGraph.
Graph
,
DIFGraph
,
Hierarchy
Field Summary |
---|
Fields inherited from class mapss.dif.graph.hierarchy.Hierarchy |
---|
_graph, _hierarchyName, _parent, _ports, _superNodes |
Constructor Summary | |
---|---|
DIFHierarchy(DIFGraph graph)
Construct a hierarchy object with an empty name. |
|
DIFHierarchy(DIFGraph graph,
java.lang.String name)
Construct a hierarchy object with a name. |
Method Summary | |
---|---|
protected mocgraph.Edge |
_copyEdge(mocgraph.Edge edge,
mocgraph.Node source,
mocgraph.Node sink)
Returns a copy of the edge with the given source and sink nodes as well as adding the new edge to the underlying graph. |
protected mocgraph.Graph |
_graphType()
Returns an empty DIFGraph . |
Hierarchy |
flatten(mocgraph.Node superNode)
Override Hierarchy.flatten(Node) . |
DIFAttribute |
getAttribute(Port port,
java.lang.String name)
Returns the DIFAttribute associated with port. |
java.util.List |
getAttributes(Port port)
Returns a List of DIFAttribute associated with port. |
DIFHierarchy |
mirror()
Completely mirror/clone this hierarchy, sub-hierarchies, graphs, attributes, and parameters. |
Hierarchy |
mirror(boolean cloneWeights)
Override Hierarchy.mirror(boolean) to restrict
to always clone weights. |
DIFHierarchy |
mirror(java.util.Map mirrorMap)
Mirror/clone this hierarchy, sub-hierarchies, graphs, attributes, and parameters based on the given mirrorMap |
void |
setAttribute(Port port,
DIFAttribute attribute)
Sets an attribute of a Port. |
Methods inherited from class mapss.dif.graph.hierarchy.Hierarchy |
---|
_mirrorGraph, _putSuperNode, _removeSuperNode, addSuperNode, deepFlatten, deepPurge, disconnect, disconnectSuperNode, flatten, getGraph, getName, getParent, getPorts, getSuperNodes, hierarchyGraph, isDirected, purge, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DIFHierarchy(DIFGraph graph)
graph
- The graph object that backs the hierarchy.public DIFHierarchy(DIFGraph graph, java.lang.String name)
graph
- The graph object that backs the hierarchy.name
- Name of the hierarchy.Method Detail |
---|
public DIFAttribute getAttribute(Port port, java.lang.String name)
port
- A Port in this hierarchy.name
- The name of this DIFAttribute.
HierarchyException
- If the port is not contained in
this hierarchy.DIFAttribute
,
AttributeContainer
public java.util.List getAttributes(Port port)
port
- A Port in this hierarchy.
HierarchyException
- If the port is not contained in
this hierarchy.AttributeContainer
public Hierarchy flatten(mocgraph.Node superNode)
Hierarchy.flatten(Node)
.
Support set the production and consumption attribute of sub port to
the edge in the flattened graph. Also support reset the attribute
value that refers to the sub port to the new edge or outer port in
the flattened graph.Note that the original hierarchy is modified and cannot be restored. If superNode is not actually a super node (it is just a normal node), this hierarchy object won't be modified and this method returns null.
flatten
in class Hierarchy
superNode
- A super node in this hierarchy.
public Hierarchy mirror(boolean cloneWeights)
Hierarchy.mirror(boolean)
to restrict
to always clone weights. Note that DIFGraph requires all elements
to have proper weights.
mirror
in class Hierarchy
cloneWeights
- Weights of the nodes and edges will be cloned if
true.
public DIFHierarchy mirror()
public DIFHierarchy mirror(java.util.Map mirrorMap)
public void setAttribute(Port port, DIFAttribute attribute)
DIF utilizes edge weights to record the production rate and consumption rate of the source node and sink node of that edge. No edge will be built between a nod and its associated port. In this situation, DIF specifies the production rate and consumption rate as port attributes. Therefore, "production" and "consumption" attributes are reserved for ports in this purpose. Because ports do not have weights to further distinguish between different types of weights (ex: CSDF, BCSDF, SDF, HSDF), users need to be very careful about assigning the "production" and "consumption" attributes.
A port cannot have both "production" and "consumption" attributes at
the same time. Because Port
is
directional.
port
- A port in this hierarchy.attribute
- A DIFAttribute.
HierarchyException
- If the port is not contained in
this hierarchy.
java.lang.IllegalArgumentException
- If the name of attribute is null.protected mocgraph.Edge _copyEdge(mocgraph.Edge edge, mocgraph.Node source, mocgraph.Node sink)
Hierarchy
_copyEdge
in class Hierarchy
edge
- Original edge.source
- New source node.sink
- New sink node.
protected mocgraph.Graph _graphType()
DIFGraph
.
_graphType
in class Hierarchy
DIFGraph
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |