public class MirrorTransformerStrategy extends CachedStrategy implements MirrorTransformer
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) |
Constructor and Description |
---|
MirrorTransformerStrategy(Graph graph)
Construct a transformer for a given graph.
|
Modifier and Type | Method and Description |
---|---|
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.
|
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
graph
public MirrorTransformerStrategy(Graph graph)
graph
- The given graph.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()
protected java.lang.Object _compute()
_compute
in class CachedStrategy
Object
.