ptolemy.graph.analysis.analyzer
Interface Transformer

All Superinterfaces:
Analyzer, GraphAnalyzer
All Known Subinterfaces:
ClusterNodesTransformer, MirrorTransformer
All Known Implementing Classes:
ClusterNodesTransformerStrategy, MirrorTransformerStrategy

public interface Transformer
extends GraphAnalyzer

A base interface for transformers. Transformers are graph analyzers which transform a graph into another graph and they provide a bilateral way to retrieve the original elements of the graph from the new (transformed) ones and vice versa. If only unilateral relation is being considered, this can be communicated to the client through the hasBackwardMapping() and hasForwardMapping() methods.

Since:
Ptolemy II 4.0
Version:
$Id: Transformer.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Shahrooz Shahparnia, Shuvra S. Bhattacharyya
Accepted Rating:
Red (ssb)
Proposed Rating:
Red (shahrooz)

Method Summary
 boolean hasBackwardMapping()
          Specify if this transformer has a mapping from the transformed version to the original version or not.
 boolean hasForwardMapping()
          Specify if this transformer has a mapping from the original version to the transformed version or not.
 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.
 
Methods inherited from interface ptolemy.graph.analysis.analyzer.GraphAnalyzer
graph
 
Methods inherited from interface ptolemy.graph.analysis.analyzer.Analyzer
toString, valid
 

Method Detail

hasBackwardMapping

boolean hasBackwardMapping()
Specify if this transformer has a mapping from the transformed version to the original version or not.

Returns:
True if the implementation of the transformer supports backward mapping.

hasForwardMapping

boolean hasForwardMapping()
Specify if this transformer has a mapping from the original version to the transformed version or not.

Returns:
True if the implementation of the transformer supports forward mapping.

originalVersionOf

java.lang.Object originalVersionOf(java.lang.Object transformedObject)
Return the original version of given object in the transformed graph. The method should be defined in implementing classes to return the original version of the given object. The transformed objects and a mapping between the original and the transformed objects are created during the transformation process in a specific algorithm (strategy).

Parameters:
transformedObject - The given object in the transformed graph.
Returns:
Return the original version the given object.

transformedVersionOf

java.lang.Object transformedVersionOf(java.lang.Object originalObject)
Return the transformed version of a given object in the original graph. The method should be defined in implementing classes to return the transformed version of the given object. The transformed objects and a mapping between the original and the transformed objects are created during the transformation process in a specific algorithm (strategy).

Parameters:
originalObject - The given object in the original graph.
Returns:
Return the transformed version of the given object.