|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.graph.analysis.strategy.Strategy
ptolemy.graph.analysis.strategy.CachedStrategy
ptolemy.graph.analysis.strategy.MirrorTransformerStrategy
public class MirrorTransformerStrategy
A mirror transformer for graphs.
In the cloneWeight(boolean)
method, users can also specify whether to clone node
and edge weights. For non cloneable
weights a CloneNotSupportedException
will be thrown by
the virtual machine.
Red (ssb) |
Red (shahrooz) |
Field Summary | |
---|---|
private boolean |
_cloneWeights
|
private Graph |
_graph
|
private java.util.HashMap |
_originalVersion
|
private java.util.HashMap |
_transformedVersion
|
Constructor Summary | |
---|---|
MirrorTransformerStrategy(Graph graph)
Construct a transformer for a given graph. |
Method Summary | |
---|---|
protected java.lang.Object |
_compute()
The computation associated with this strategy. |
void |
cloneWeight(boolean status)
Changes the status of the graph returned by the mirror() method. |
boolean |
hasBackwardMapping()
Specify if this transformation has a mapping from the transformed version to the original version or not. |
boolean |
hasForwardMapping()
Specify if this transformation has a mapping from the original version to the transformed version or not. |
Graph |
mirror()
Create a mirror of the graph associated with this analyzer with the same runtime class. |
Graph |
mirror(Graph graph,
boolean cloneWeights)
Return a mirror of this graph in the form of the argument graph type (i.e., the run-time type of the returned graph is that of the argument graph). |
java.lang.Object |
originalVersionOf(java.lang.Object transformedObject)
Return the original version of given object in the transformed graph. |
java.lang.Object |
transformedVersionOf(java.lang.Object originalObject)
Return the transformed version of a given object in the original graph. |
boolean |
valid()
Always valid. |
Methods inherited from class ptolemy.graph.analysis.strategy.CachedStrategy |
---|
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.graph.analysis.analyzer.GraphAnalyzer |
---|
graph |
Methods inherited from interface ptolemy.graph.analysis.analyzer.Analyzer |
---|
toString |
Field Detail |
---|
private Graph _graph
private boolean _cloneWeights
private java.util.HashMap _originalVersion
private java.util.HashMap _transformedVersion
Constructor Detail |
---|
public MirrorTransformerStrategy(Graph graph)
graph
- The given graph.Method Detail |
---|
public void cloneWeight(boolean status)
mirror()
method.
If true, the weights will also be cloned in the next calls to the
mirror()
method.
cloneWeight
in interface MirrorTransformer
status
- If true, the weights will also be cloned.public boolean hasBackwardMapping()
hasBackwardMapping
in interface Transformer
public boolean hasForwardMapping()
hasForwardMapping
in interface Transformer
public Graph mirror()
mirror
in interface MirrorTransformer
public Graph mirror(Graph graph, boolean cloneWeights)
The returned mirror graph has the same ordering(integer labeling) of nodes(edges) as the original graph. Therefore, correspondent nodes(edges) pairs in both graphs can be gotten through same labels. In other words, labels can also be used to relate mirror and original nodes(edges).
mirror
in interface MirrorTransformer
graph
- The type of the graph which the graph associated with
this analyzer is being mirrored to.cloneWeights
- If true, the weights will also be cloned.
public java.lang.Object originalVersionOf(java.lang.Object transformedObject)
originalVersionOf
in interface Transformer
transformedObject
- The given object in the transformed graph.
public java.lang.Object transformedVersionOf(java.lang.Object originalObject)
transformedVersionOf
in interface Transformer
originalObject
- The given object in the original graph.
public boolean valid()
valid
in interface Analyzer
protected java.lang.Object _compute()
_compute
in class CachedStrategy
Object
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |