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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.types.AbstractInheritance
All Implemented Interfaces:
DomainElement, DomainInheritance, DomainNamedElement, DomainNamespace, DomainType, Nameable, OCLValue
Direct Known Subclasses:
ExecutorType, ReflectiveType

public abstract class AbstractInheritance
extends java.lang.Object
implements DomainInheritance


Nested Class Summary
static class AbstractInheritance.FragmentIterable
           
 
Field Summary
protected  DomainPackage evaluationPackage
           
protected  int flags
           
protected  java.lang.String name
           
protected  java.util.Map<java.lang.String,DomainOperation> operationMap
           
static int ORDERED
           
protected  java.util.Map<java.lang.String,DomainProperty> propertyMap
           
static int UNIQUE
           
 
Fields inherited from interface org.eclipse.ocl.examples.domain.elements.DomainInheritance
EMPTY_ARRAY
 
Constructor Summary
AbstractInheritance(java.lang.String name, DomainPackage evaluationPackage, int flags)
           
 
Method Summary
 boolean conformsTo(DomainStandardLibrary standardLibrary, DomainType type)
          Return true if this type conform to thatType within standardLibrary.
 DomainInheritance getCommonInheritance(DomainInheritance thatInheritance)
           
 DomainType getCommonType(IdResolver idResolver, DomainType type)
          Return the most derived type com mon to this type and thatType within standardLibrary.
 DomainFragment getFragment(DomainInheritance thatInheritance)
           
 DomainInheritance getInheritance(DomainStandardLibrary standardLibrary)
          Return the inheritance description for this type within standardLibrary.
 DomainOperation getMemberOperation(OperationId operationId)
           
 java.lang.String getName()
          Return the name of this type (without any decorations for specializations).
 DomainType getNormalizedType(DomainStandardLibrary standardLibrary)
          Return the unique executable form of this type within standardLibrary.
protected  DomainInheritance getOclAnyInheritance()
           
 java.util.List<? extends DomainConstraint> getOwnedInvariant()
           
 java.util.List<? extends DomainConstraint> getOwnedRule()
           
 DomainPackage getPackage()
          Return the package containing this type.
static void initStatics()
          A simple public static method that may be used to force class initialization.
 boolean isEqualTo(DomainStandardLibrary standardLibrary, DomainType type)
          Return true if this is the same type as thatType within standardLibrary.
 boolean isEqualToUnspecializedType(DomainStandardLibrary standardLibrary, DomainType type)
           
 boolean isInvalid()
          Return true if this is an invalid type (with an associated error message).
 boolean isOrdered()
          Return true if this type is a Collection type and has ordered elements.
 boolean isSubInheritanceOf(DomainInheritance thatInheritance)
           
 boolean isSuperInheritanceOf(DomainStandardLibrary standardLibrary, DomainInheritance thatInheritance)
           
 boolean isUndefined()
           
 boolean isUnique()
          Return true if this type is a Collection type and has unique elements.
 LibraryFeature lookupImplementation(DomainStandardLibrary standardLibrary, DomainOperation staticOperation)
          Return the dynamic (overloaded) implementation of the staticOperation applicable to the types managed by the given Standard Library.
 DomainOperation lookupLocalOperation(DomainStandardLibrary standardLibrary, java.lang.String operationName, DomainInheritance... argumentTypes)
           
 boolean oclEquals(OCLValue thatValue)
          Return true if this is an equivalent OCL value to thatValue.
 int oclHashCode()
           
 DomainType specializeIn(DomainCallExp expr, DomainType selfType)
           
 java.lang.String toString()
           
 
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.DomainInheritance
getAllOperations, getAllProperties, getAllSuperFragments, getDepth, getFragment, getIndex, getIndexes, getMemberProperty, getSelfFragment, getStandardLibrary, getSuperFragments
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainType
createInstance, createInstance, getLocalOperations, getLocalProperties, getLocalSuperTypes, getMetaTypeName, getOwnedAttribute, getOwnedOperation, getTypeId, getTypeParameters
 

Field Detail

ORDERED

public static final int ORDERED
See Also:
Constant Field Values

UNIQUE

public static final int UNIQUE
See Also:
Constant Field Values

name

@NonNull
protected final java.lang.String name

evaluationPackage

@NonNull
protected final DomainPackage evaluationPackage

flags

protected final int flags

operationMap

protected java.util.Map<java.lang.String,DomainOperation> operationMap

propertyMap

protected java.util.Map<java.lang.String,DomainProperty> propertyMap
Constructor Detail

AbstractInheritance

public AbstractInheritance(@NonNull
                           java.lang.String name,
                           @NonNull
                           DomainPackage evaluationPackage,
                           int flags)
Method Detail

initStatics

public static void initStatics()
A simple public static method that may be used to force class initialization.


conformsTo

public boolean conformsTo(@NonNull
                          DomainStandardLibrary standardLibrary,
                          @NonNull
                          DomainType type)
Description copied from interface: DomainType
Return true if this type conform to thatType within standardLibrary.

Specified by:
conformsTo in interface DomainType

getCommonInheritance

@NonNull
public DomainInheritance getCommonInheritance(@NonNull
                                                      DomainInheritance thatInheritance)
Specified by:
getCommonInheritance in interface DomainInheritance

getCommonType

@NonNull
public DomainType getCommonType(@NonNull
                                        IdResolver idResolver,
                                        @NonNull
                                        DomainType type)
Description copied from interface: DomainType
Return the most derived type com mon to this type and thatType within standardLibrary.

Specified by:
getCommonType in interface DomainType

getFragment

@Nullable
public DomainFragment getFragment(@NonNull
                                           DomainInheritance thatInheritance)
Specified by:
getFragment in interface DomainInheritance

getInheritance

@NonNull
public DomainInheritance getInheritance(@NonNull
                                                DomainStandardLibrary standardLibrary)
Description copied from interface: DomainType
Return the inheritance description for this type within standardLibrary.

Specified by:
getInheritance in interface DomainType

getMemberOperation

@Nullable
public DomainOperation getMemberOperation(@NonNull
                                                   OperationId operationId)
Specified by:
getMemberOperation in interface DomainInheritance

getName

public final java.lang.String getName()
Description copied from interface: DomainType
Return the name of this type (without any decorations for specializations).

Specified by:
getName in interface DomainType
Specified by:
getName in interface Nameable

getNormalizedType

@NonNull
public DomainType getNormalizedType(@NonNull
                                            DomainStandardLibrary standardLibrary)
Description copied from interface: DomainType
Return the unique executable form of this type within standardLibrary.

Specified by:
getNormalizedType in interface DomainType

getOclAnyInheritance

@NonNull
protected DomainInheritance getOclAnyInheritance()

getOwnedInvariant

@NonNull
public java.util.List<? extends DomainConstraint> getOwnedInvariant()
Specified by:
getOwnedInvariant in interface DomainType

getOwnedRule

@NonNull
public java.util.List<? extends DomainConstraint> getOwnedRule()
Specified by:
getOwnedRule in interface DomainNamespace

getPackage

@NonNull
public final DomainPackage getPackage()
Description copied from interface: DomainType
Return the package containing this type.

Specified by:
getPackage in interface DomainType

isEqualTo

public boolean isEqualTo(@NonNull
                         DomainStandardLibrary standardLibrary,
                         @NonNull
                         DomainType type)
Description copied from interface: DomainType
Return true if this is the same type as thatType within standardLibrary.

Specified by:
isEqualTo in interface DomainType

isEqualToUnspecializedType

public boolean isEqualToUnspecializedType(@NonNull
                                          DomainStandardLibrary standardLibrary,
                                          @NonNull
                                          DomainType type)
Specified by:
isEqualToUnspecializedType in interface DomainType

isInvalid

public boolean isInvalid()
Description copied from interface: DomainType
Return true if this is an invalid type (with an associated error message).

Specified by:
isInvalid in interface DomainType

isOrdered

public boolean isOrdered()
Description copied from interface: DomainType
Return true if this type is a Collection type and has ordered elements.

Specified by:
isOrdered in interface DomainType

isSubInheritanceOf

public boolean isSubInheritanceOf(@NonNull
                                  DomainInheritance thatInheritance)
Specified by:
isSubInheritanceOf in interface DomainInheritance

isSuperInheritanceOf

public boolean isSuperInheritanceOf(@NonNull
                                    DomainStandardLibrary standardLibrary,
                                    @NonNull
                                    DomainInheritance thatInheritance)
Specified by:
isSuperInheritanceOf in interface DomainInheritance

isUndefined

public boolean isUndefined()
Specified by:
isUndefined in interface DomainInheritance

isUnique

public boolean isUnique()
Description copied from interface: DomainType
Return true if this type is a Collection type and has unique elements.

Specified by:
isUnique in interface DomainType

lookupImplementation

@NonNull
public LibraryFeature lookupImplementation(@NonNull
                                                   DomainStandardLibrary standardLibrary,
                                                   @NonNull
                                                   DomainOperation staticOperation)
Description copied from interface: DomainType
Return the dynamic (overloaded) implementation of the staticOperation applicable to the types managed by the given Standard Library.

Specified by:
lookupImplementation in interface DomainType

lookupLocalOperation

@Nullable
public DomainOperation lookupLocalOperation(@NonNull
                                                     DomainStandardLibrary standardLibrary,
                                                     @NonNull
                                                     java.lang.String operationName,
                                                     DomainInheritance... argumentTypes)
Specified by:
lookupLocalOperation in interface DomainInheritance

oclEquals

public boolean oclEquals(@NonNull
                         OCLValue thatValue)
Description copied from interface: OCLValue
Return true if this is an equivalent OCL value to thatValue.

Note that the caller must check that the argument is an OCLValue and should also check for the shortcut case that this == thatValue. Implementations are therefore wasting time if they re-implement the shortcut.

Specified by:
oclEquals in interface OCLValue

oclHashCode

public int oclHashCode()
Specified by:
oclHashCode in interface OCLValue

specializeIn

public DomainType specializeIn(@NonNull
                               DomainCallExp expr,
                               DomainType selfType)
Specified by:
specializeIn in interface DomainType

toString

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