org.eclipse.ocl.examples.domain.types
Class AbstractFragment
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
derivedInheritance
public final DomainInheritance derivedInheritance
baseInheritance
public final DomainInheritance baseInheritance
AbstractFragment
public AbstractFragment(DomainInheritance derivedInheritance,
DomainInheritance baseInheritance)
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