Class ClusterNodesTransformerStrategy

  • All Implemented Interfaces:
    Analyzer, ClusterNodesTransformer, GraphAnalyzer, Transformer

    public class ClusterNodesTransformerStrategy
    extends CachedStrategy
    implements ClusterNodesTransformer
    Strategy for cluster transformers for graphs. The nodes of a graph given in a collection are being removed (clustered) and all of them are replaced by a single node called super node.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Shahrooz Shahparnia based on a method by Ming Yung Ko.
    See Also:
    ClusterNodesAnalysis
    Pt.AcceptedRating:
    Red (ssb)
    Pt.ProposedRating:
    Red (shahrooz)
    • Constructor Detail

      • ClusterNodesTransformerStrategy

        public ClusterNodesTransformerStrategy​(Graph graph,
                                               java.util.Collection nodeCollection,
                                               Node superNode)
        Construct a clusterer for a given graph.
        Parameters:
        graph - The given graph.
        nodeCollection - The collection of nodes to be clustered.
        superNode - The super node that replaces the clustered nodes.
    • Method Detail

      • hasBackwardMapping

        public boolean hasBackwardMapping()
        Specify if this transformation has a mapping from the transformed version to the original version or not. This implementation does not.
        Specified by:
        hasBackwardMapping in interface Transformer
        Returns:
        True If the implementation of the transformer supports backward mapping.
      • hasForwardMapping

        public boolean hasForwardMapping()
        Specify if this transformation has a mapping from the original version to the transformed version or not. This implementation does not.
        Specified by:
        hasForwardMapping in interface Transformer
        Returns:
        True If the implementation of the transformer supports forward mapping.
      • originalVersionOf

        public java.lang.Object originalVersionOf​(java.lang.Object dummy)
        Unsupported operation.
        Specified by:
        originalVersionOf in interface Transformer
        Parameters:
        dummy - The given object in the transformed graph.
        Returns:
        Return the original version the given object.
        Throws:
        java.lang.UnsupportedOperationException - If this method is called in any case.
      • transformedVersionOf

        public java.lang.Object transformedVersionOf​(java.lang.Object dummy)
        Unsupported operation.
        Specified by:
        transformedVersionOf in interface Transformer
        Parameters:
        dummy - The given object in the original graph.
        Returns:
        Return the transformed version of the given object.
        Throws:
        java.lang.UnsupportedOperationException - If this method is called in any case.
      • valid

        public boolean valid()
        Always valid.
        Specified by:
        valid in interface Analyzer
        Returns:
        True always.
      • _compute

        protected java.lang.Object _compute()
        The computation associated with this strategy.
        Overrides:
        _compute in class CachedStrategy
        Returns:
        The mirror graph as an Object.