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, getLocalOperations, getLocalProperties
 

Field Detail

derivedInheritance

@NonNull
public final DomainInheritance derivedInheritance

baseInheritance

@NonNull
public final DomainInheritance baseInheritance
Constructor Detail

AbstractFragment

public AbstractFragment(@NonNull
                        DomainInheritance derivedInheritance,
                        @NonNull
                        DomainInheritance baseInheritance)
Method Detail

getBaseFragment

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

getBaseInheritance

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

getDerivedInheritance

@NonNull
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