org.eclipse.ocl.examples.domain.types
Class AbstractFragment

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.types.AbstractFragment
All Implemented Interfaces:
DomainFragment
Direct Known Subclasses:
ExecutorFragment, ReflectiveFragment

public abstract class AbstractFragment
extends java.lang.Object
implements DomainFragment


Field Summary
 DomainInheritance baseInheritance
           
 DomainInheritance derivedInheritance
           
 
Constructor Summary
AbstractFragment(DomainInheritance derivedInheritance, DomainInheritance baseInheritance)
           
 
Method Summary
 DomainFragment getBaseFragment()
           
 DomainInheritance getBaseInheritance()
           
 DomainInheritance getDerivedInheritance()
           
 java.lang.String toString()
          Return true if anOperation overloads an existing operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainFragment
getImplementation
 

Field Detail

derivedInheritance

public final DomainInheritance derivedInheritance

baseInheritance

public final DomainInheritance baseInheritance
Constructor Detail

AbstractFragment

public AbstractFragment(DomainInheritance derivedInheritance,
                        DomainInheritance baseInheritance)
Method Detail

getBaseFragment

public final DomainFragment getBaseFragment()
Specified by:
getBaseFragment in interface DomainFragment

getBaseInheritance

public final DomainInheritance getBaseInheritance()
Specified by:
getBaseInheritance in interface DomainFragment

getDerivedInheritance

public final DomainInheritance getDerivedInheritance()
Specified by:
getDerivedInheritance in interface DomainFragment

toString

public java.lang.String toString()
Return true if anOperation overloads an existing operation. protected boolean isOverload(DomainOperation anOperation) { int depth = derivedInheritance.getDepth(); for (int i = 0; i <= depth-1; i++) { for (DomainInheritance superInheritance : derivedInheritance.getSuperInheritances(depth)) { DomainFragment baseFragment = superInheritance.getSelfFragment(); for (DomainOperation baseOperation : baseFragment.getOperations()) { if (isOverload(anOperation, baseOperation)) { return true; } } } } return false; }

Overrides:
toString in class java.lang.Object