Class SelfLoopStrategy

  • All Implemented Interfaces:
    Analyzer, GraphAnalyzer, SelfLoopAnalyzer

    public class SelfLoopStrategy
    extends CachedStrategy
    implements SelfLoopAnalyzer
    Computation of self-loops in a graph. The returned collection cannot be modified.

    This analysis requires O(E) time, where E is the number of edges in the graph.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Shuvra S. Bhattacharyya, Shahrooz Shahparnia
    See Also:
    SelfLoopAnalysis
    Pt.AcceptedRating:
    Red (ssb)
    Pt.ProposedRating:
    Red (ssb)
    • Constructor Detail

      • SelfLoopStrategy

        public SelfLoopStrategy​(Graph graph)
        Construct an instance of this strategy for a given graph.
        Parameters:
        graph - The given graph.
    • Method Detail

      • edges

        public java.util.List edges()
        Compute the self-loop edges in the graph in the form of a collection. Each element of the collection is an Edge.
        Specified by:
        edges in interface SelfLoopAnalyzer
        Returns:
        The self-loop edges.
      • toString

        public java.lang.String toString()
        Return a description of the analyzer.
        Specified by:
        toString in interface Analyzer
        Overrides:
        toString in class CachedStrategy
        Returns:
        Return a description of the analyzer..
      • valid

        public boolean valid()
        Check for validity of this strategy.
        Specified by:
        valid in interface Analyzer
        Returns:
        True since this strategy is always valid.
      • _compute

        protected java.lang.Object _compute()
        Compute the self-loop edges in the graph in the form of a collection. Each element of the collection is an Edge.
        Overrides:
        _compute in class CachedStrategy
        Returns:
        The self-loop edges.
      • _convertResult

        protected java.lang.Object _convertResult()
        Return the result of this analysis (collection of self-loop edges) in a form that cannot be modified.
        Returns:
        The analysis result in unmodifiable form.