public class MirrorTransformation extends Analysis
To relate nodes and edges from the original and the mirrored graph
the transformedVersionOf(java.lang.Object)
and originalVersionOf(java.lang.Object)
methods are
provided.
Labels can also be used to relate mirror and original
nodes(edges).
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.
Constructor and Description |
---|
MirrorTransformation(Graph graph)
Construct a transformation for a given graph with a default analyzer.
|
MirrorTransformation(MirrorTransformer analyzer)
Construct a transformation for a given graph and a given analyzer.
|
Modifier and Type | Method and Description |
---|---|
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.String |
toString()
Return a description of the analysis and the associated analyzer.
|
java.lang.Object |
transformedVersionOf(java.lang.Object originalObject)
Return the transformed version of a given object in the original graph.
|
boolean |
validAnalyzerInterface(Analyzer analyzer)
Check if a given analyzer is compatible with this analysis.
|
analyzer, changeAnalyzer, graph, valid
public MirrorTransformation(Graph graph)
graph
- The given graph.public MirrorTransformation(MirrorTransformer analyzer)
analyzer
- The default Analyzer.public void cloneWeight(boolean status)
mirror()
method.
If true, the weights will also be cloned in the next calls to the
mirror()
method.status
- If true, the weights will also be cloned.public boolean hasBackwardMapping()
public boolean hasForwardMapping()
public Graph mirror()
public Graph mirror(Graph graph, boolean cloneWeights)
In this method, users can also specify whether to clone node and edge weights.
graph
- The graph.cloneWeights
- True if the weights will also be cloned.public java.lang.Object originalVersionOf(java.lang.Object transformedObject)
transformedObject
- The given object in the transformed graph.public java.lang.String toString()
public java.lang.Object transformedVersionOf(java.lang.Object originalObject)
originalObject
- The given object in the original graph.public boolean validAnalyzerInterface(Analyzer analyzer)
validAnalyzerInterface
in class Analysis
analyzer
- The given analyzer.