Package ptolemy.graph.analysis.strategy
Class SelfLoopStrategy
- java.lang.Object
-
- ptolemy.graph.analysis.strategy.CachedStrategy
-
- ptolemy.graph.analysis.strategy.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 Summary
Constructors Constructor Description SelfLoopStrategy(Graph graph)
Construct an instance of this strategy for a given graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
_compute()
Compute the self-loop edges in the graph in the form of a collection.protected java.lang.Object
_convertResult()
Return the result of this analysis (collection of self-loop edges) in a form that cannot be modified.java.util.List
edges()
Compute the self-loop edges in the graph in the form of a collection.java.lang.String
toString()
Return a description of the analyzer.boolean
valid()
Check for validity of this strategy.-
Methods inherited from class ptolemy.graph.analysis.strategy.CachedStrategy
_convertResult, _result, cachingStatus, disableCaching, enableCaching, getCachedResult, graph, obsolete, reset, setCachedResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.graph.analysis.analyzer.GraphAnalyzer
graph
-
-
-
-
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 anEdge
.- Specified by:
edges
in interfaceSelfLoopAnalyzer
- Returns:
- The self-loop edges.
-
toString
public java.lang.String toString()
Return a description of the analyzer.- Specified by:
toString
in interfaceAnalyzer
- Overrides:
toString
in classCachedStrategy
- Returns:
- Return a description of the analyzer..
-
valid
public boolean valid()
Check for validity of this strategy.
-
_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 anEdge
.- Overrides:
_compute
in classCachedStrategy
- 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.
-
-