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, DomainType
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
           
static int ORDERED
           
static int UNIQUE
           
 
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.
 ObjectValue createInstance(ValueFactory valueFactory)
          Return a new instance of this type from valueFactory.
 Value createInstance(ValueFactory valueFactory, java.lang.String value)
          Return a new instance of this data type from valueFactory.
 DomainInheritance getCommonInheritance(DomainInheritance thatInheritance)
           
 DomainType getCommonType(DomainStandardLibrary standardLibrary, 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.
 java.lang.String getName()
          Return the name of this type (without any decoratuions for specializations).
 DomainType getNormalizedType(DomainStandardLibrary standardLibrary)
          Return the unique executable form of this type within standardLibrary.
protected  DomainInheritance getOclAnyInheritance()
           
 DomainPackage getPackage()
          Return the package containing this type.
 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 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)
           
 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
getAllSuperFragments, getDepth, getFragment, getIndex, getIndexes, getSelfFragment, getStandardLibrary, getSuperFragments
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainType
getLocalOperations, getLocalProperties, getLocalSuperTypes, getMetaTypeName
 

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

protected final java.lang.String name

evaluationPackage

protected final DomainPackage evaluationPackage

flags

protected final int flags
Constructor Detail

AbstractInheritance

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

conformsTo

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

Specified by:
conformsTo in interface DomainType

createInstance

public ObjectValue createInstance(ValueFactory valueFactory)
Description copied from interface: DomainType
Return a new instance of this type from valueFactory. Properties may be initialised using DomainProperty.setValue(ObjectValue, Value) provided no side-effect free OCL functionality is permitted to use the ObjectValue until initialisation has completed.

Specified by:
createInstance in interface DomainType

createInstance

public Value createInstance(ValueFactory valueFactory,
                            java.lang.String value)
Description copied from interface: DomainType
Return a new instance of this data type from valueFactory.

Specified by:
createInstance in interface DomainType
value - string initial value

getCommonInheritance

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

getCommonType

public DomainType getCommonType(DomainStandardLibrary standardLibrary,
                                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

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

getInheritance

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

Specified by:
getInheritance in interface DomainType

getName

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

Specified by:
getName in interface DomainType

getNormalizedType

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

Specified by:
getNormalizedType in interface DomainType

getOclAnyInheritance

protected DomainInheritance getOclAnyInheritance()

getPackage

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(DomainStandardLibrary standardLibrary,
                         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(DomainStandardLibrary standardLibrary,
                                          DomainType type)
Specified by:
isEqualToUnspecializedType 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(DomainInheritance thatInheritance)
Specified by:
isSubInheritanceOf in interface DomainInheritance

isSuperInheritanceOf

public boolean isSuperInheritanceOf(DomainStandardLibrary standardLibrary,
                                    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

public LibraryFeature lookupImplementation(DomainStandardLibrary standardLibrary,
                                           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

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

toString

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