org.eclipse.ocl.examples.codegen.cse
Class AbstractAnalysis

java.lang.Object
  extended by org.eclipse.ocl.examples.codegen.cse.AbstractAnalysis
All Implemented Interfaces:
java.lang.Comparable<AbstractAnalysis>
Direct Known Subclasses:
CommonAnalysis, SimpleAnalysis

public abstract class AbstractAnalysis
extends java.lang.Object
implements java.lang.Comparable<AbstractAnalysis>

An AbstractAnalysis describes one or more occurrences of a structurally identical tree of CGValuedElements.

A SimpleAnalysis describes a single occurrence that may grow into:

A CommonAnalysis describes a multiple occurrence.


Constructor Summary
AbstractAnalysis()
           
 
Method Summary
abstract  CommonAnalysis addAnalysis(AbstractAnalysis anAnalysis)
          Return the analysis that shares this analysis and anAnalysis
abstract  CommonAnalysis addCommonAnalysis(CommonAnalysis commonAnalysis)
          Return the analysis that shares this analysis and commonAnalysis
abstract  CommonAnalysis addSimpleAnalysis(SimpleAnalysis simpleAnalysis)
          Return the analysis that shares this analysis and simpleAnalysis
 int compareTo(AbstractAnalysis o2)
           
abstract  int getMaxDepth()
          Return the depth of the deepest shared analysis.
abstract  int getMinDepth()
          Return the depth of the shallowest shared analysis.
abstract  CGValuedElement getPrimaryElement()
          Return the CG element to be used for this analysis.
abstract  int getStructuralHashCode()
          Return the hash code derived from the tree structure of this analysis.
abstract  boolean isStructurallyEqualTo(AbstractAnalysis thatAnalysis)
          Return true if the tree structure of this analysis is identical to thatAnalysis.
abstract  boolean isStructurallyEqualTo(SimpleAnalysis thatAnalysis)
          Return true if the tree structure of this analysis is identical to thatAnalysis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAnalysis

public AbstractAnalysis()
Method Detail

addAnalysis

@NonNull
public abstract CommonAnalysis addAnalysis(@NonNull
                                                   AbstractAnalysis anAnalysis)
Return the analysis that shares this analysis and anAnalysis


addCommonAnalysis

@NonNull
public abstract CommonAnalysis addCommonAnalysis(@NonNull
                                                         CommonAnalysis commonAnalysis)
Return the analysis that shares this analysis and commonAnalysis


addSimpleAnalysis

@NonNull
public abstract CommonAnalysis addSimpleAnalysis(@NonNull
                                                         SimpleAnalysis simpleAnalysis)
Return the analysis that shares this analysis and simpleAnalysis


compareTo

public int compareTo(AbstractAnalysis o2)
Specified by:
compareTo in interface java.lang.Comparable<AbstractAnalysis>

getMaxDepth

public abstract int getMaxDepth()
Return the depth of the deepest shared analysis.


getMinDepth

public abstract int getMinDepth()
Return the depth of the shallowest shared analysis.


getPrimaryElement

@NonNull
public abstract CGValuedElement getPrimaryElement()
Return the CG element to be used for this analysis. For common subexpressions, the return is the shallowest CG element and is visible to all other secondary elements.


getStructuralHashCode

public abstract int getStructuralHashCode()
Return the hash code derived from the tree structure of this analysis.


isStructurallyEqualTo

public abstract boolean isStructurallyEqualTo(@NonNull
                                              AbstractAnalysis thatAnalysis)
Return true if the tree structure of this analysis is identical to thatAnalysis.


isStructurallyEqualTo

public abstract boolean isStructurallyEqualTo(@NonNull
                                              SimpleAnalysis thatAnalysis)
Return true if the tree structure of this analysis is identical to thatAnalysis.