public class Analysis
extends java.lang.Object
The organization of the package follows:
Classes in ptolemy.graph.analysis consists of different wrappers in which a client can plug a requested strategy/algorithm for an analysis. Strategies for a given analysis implement the same interface defined in ptolemy.graph.analysis.analyzer. Therefore from now on we will use the name analyzer for all the strategies that implement the same interface and therefore solve the same problem. Analysis classes access the plugged-in strategy class through these interfaces.
In the base class methods are provided in order to dynamically change the analyzer of the current analysis and also to check if a given analyzer is applicable to the given analysis.
Analyzers that can be used in these analyses are a specialized version of
analyzers called GraphAnalyzer
.
Classes in ptolemy.graph.analysis.analyzer are the interfaces for different strategies(algorithms) used for the analysis. The strategies classes are defined in ptolemy.graph.analysis.strategy
In addition, the analysis classes provide default constructors which use predefined strategies for those clients who do not want to deal with different strategies. Although this introduces some limitations imposed by the used strategy. The documentation of such constructor will reflect the limitations, if any.
Finally, strategies can be instantiated and used independently. In this case the client will lose the possibility of dynamically changing the analyzer for the associated analysis, which would not exist at all, and there will be no default constructor therefore the client need to be familiar with the strategy that she/he is using.
Red (ssb) |
Red (shahrooz) |
Constructor and Description |
---|
Analysis(GraphAnalyzer analyzer)
Construct an analysis using a given analyzer.
|
Modifier and Type | Method and Description |
---|---|
GraphAnalyzer |
analyzer()
Return the analyzer associated with this analysis class.
|
void |
changeAnalyzer(GraphAnalyzer analyzer)
Change the analyzer associated with this analysis class to the given
analyzer.
|
Graph |
graph()
The graph associated with the analysis.
|
java.lang.String |
toString()
Return a description of the analysis and the associated analyzer.
|
boolean |
valid()
Return the validity of the associated analyzer.
|
boolean |
validAnalyzerInterface(Analyzer analyzer)
Check if a given analyzer is compatible with this analysis.
|
public Analysis(GraphAnalyzer analyzer)
analyzer
- The given analyzer.public GraphAnalyzer analyzer()
public void changeAnalyzer(GraphAnalyzer analyzer)
analyzer
- The given analyzer.InvalidAnalyzerException
- If the analyzer is not a valid
analyzer for this analysis.public Graph graph()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean valid()
public boolean validAnalyzerInterface(Analyzer analyzer)
analyzer
- The given analyzer.