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

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

public class SimpleAnalysis
extends AbstractAnalysis


Field Summary
protected  CGValuedElement cgElement
           
protected  SimpleAnalysis[] children
           
protected  int depth
           
static SimpleAnalysis[] EMPTY_LIST
           
protected  GlobalPlace globalPlace
           
protected  int structuralHashCode
           
 
Constructor Summary
SimpleAnalysis(GlobalPlace globalPlace, CGValuedElement cgElement, int depth, int structuralHashCode, SimpleAnalysis[] children)
           
 
Method Summary
 CommonAnalysis addAnalysis(AbstractAnalysis anAnalysis)
          Return the analysis that shares this analysis and anAnalysis
 CommonAnalysis addCommonAnalysis(CommonAnalysis commonAnalysis)
          Return the analysis that shares this analysis and commonAnalysis
 CommonAnalysis addSimpleAnalysis(SimpleAnalysis simpleAnalysis)
          Return the analysis that shares this analysis and simpleAnalysis
 void dispose()
           
 int getDepth()
           
 CGValuedElement getElement()
           
 int getMaxDepth()
          Return the depth of the deepest shared analysis.
 int getMinDepth()
          Return the depth of the shallowest shared analysis.
 SimpleAnalysis getParent()
           
 CGValuedElement getPrimaryElement()
          Return the CG element to be used for this analysis.
 int getStructuralHashCode()
          Return the hash code derived from the tree structure of this analysis.
 boolean isStructurallyEqualTo(AbstractAnalysis thatAnalysis)
          Return true if the tree structure of this analysis is identical to thatAnalysis.
 boolean isStructurallyEqualTo(SimpleAnalysis that)
          Return true if the tree structure of this analysis is identical to thatAnalysis.
 void setCommonAnalysis(CommonAnalysis commonAnalysis)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.ocl.examples.codegen.cse.AbstractAnalysis
compareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_LIST

@NonNull
public static final SimpleAnalysis[] EMPTY_LIST

globalPlace

@NonNull
protected final GlobalPlace globalPlace

cgElement

@NonNull
protected final CGValuedElement cgElement

depth

protected final int depth

structuralHashCode

protected final int structuralHashCode

children

@NonNull
protected final SimpleAnalysis[] children
Constructor Detail

SimpleAnalysis

public SimpleAnalysis(@NonNull
                      GlobalPlace globalPlace,
                      @NonNull
                      CGValuedElement cgElement,
                      int depth,
                      int structuralHashCode,
                      @NonNull
                      SimpleAnalysis[] children)
Method Detail

addAnalysis

@NonNull
public CommonAnalysis addAnalysis(@NonNull
                                          AbstractAnalysis anAnalysis)
Description copied from class: AbstractAnalysis
Return the analysis that shares this analysis and anAnalysis

Specified by:
addAnalysis in class AbstractAnalysis

addCommonAnalysis

@NonNull
public CommonAnalysis addCommonAnalysis(@NonNull
                                                CommonAnalysis commonAnalysis)
Description copied from class: AbstractAnalysis
Return the analysis that shares this analysis and commonAnalysis

Specified by:
addCommonAnalysis in class AbstractAnalysis

addSimpleAnalysis

@NonNull
public CommonAnalysis addSimpleAnalysis(@NonNull
                                                SimpleAnalysis simpleAnalysis)
Description copied from class: AbstractAnalysis
Return the analysis that shares this analysis and simpleAnalysis

Specified by:
addSimpleAnalysis in class AbstractAnalysis

dispose

public void dispose()

getDepth

public int getDepth()

getElement

@NonNull
public CGValuedElement getElement()

getMaxDepth

public int getMaxDepth()
Description copied from class: AbstractAnalysis
Return the depth of the deepest shared analysis.

Specified by:
getMaxDepth in class AbstractAnalysis

getMinDepth

public int getMinDepth()
Description copied from class: AbstractAnalysis
Return the depth of the shallowest shared analysis.

Specified by:
getMinDepth in class AbstractAnalysis

getParent

@Nullable
public SimpleAnalysis getParent()

getPrimaryElement

@NonNull
public CGValuedElement getPrimaryElement()
Description copied from class: AbstractAnalysis
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.

Specified by:
getPrimaryElement in class AbstractAnalysis

getStructuralHashCode

public int getStructuralHashCode()
Description copied from class: AbstractAnalysis
Return the hash code derived from the tree structure of this analysis.

Specified by:
getStructuralHashCode in class AbstractAnalysis

isStructurallyEqualTo

public boolean isStructurallyEqualTo(@NonNull
                                     AbstractAnalysis thatAnalysis)
Description copied from class: AbstractAnalysis
Return true if the tree structure of this analysis is identical to thatAnalysis.

Specified by:
isStructurallyEqualTo in class AbstractAnalysis

isStructurallyEqualTo

public boolean isStructurallyEqualTo(@NonNull
                                     SimpleAnalysis that)
Description copied from class: AbstractAnalysis
Return true if the tree structure of this analysis is identical to thatAnalysis.

Specified by:
isStructurallyEqualTo in class AbstractAnalysis

setCommonAnalysis

public void setCommonAnalysis(@NonNull
                              CommonAnalysis commonAnalysis)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object