org.eclipse.ocl.examples.library.executor
Class ReflectiveType

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

public abstract class ReflectiveType
extends AbstractInheritance

A ReflectiveType defines a Type using a compact representation suitable for efficient execution. The representation is derived reflectively from a less efficient representation.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.domain.types.AbstractInheritance
AbstractInheritance.FragmentIterable
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.domain.types.AbstractInheritance
evaluationPackage, flags, name, operationMap, ORDERED, propertyMap, UNIQUE
 
Fields inherited from interface org.eclipse.ocl.examples.domain.elements.DomainInheritance
EMPTY_ARRAY
 
Constructor Summary
ReflectiveType(java.lang.String name, ExecutorPackage evaluationPackage, int flags, ExecutorTypeParameter... typeParameters)
           
 
Method Summary
 void addSubInheritance(ReflectiveType subInheritance)
           
protected static int computeFlags(DomainType type)
           
protected abstract  AbstractFragment createFragment(DomainInheritance baseInheritance)
           
 java.lang.Object createInstance()
          Return a new instance of this type from valueFactory.
 java.lang.Object createInstance(java.lang.String value)
          Return a new instance of this data type from valueFactory.
 void dispose()
           
 boolean gatherUninstalledInheritances(java.util.List<ReflectiveType> inheritances)
          Add this Inheritance and all un-installed super-Inheritances to inheritances, returning true if this inheritance was already installed.
 AbstractInheritance.FragmentIterable getAllSuperFragments()
          Return a depth ordered, OclAny-first, OclSelf-last, Iterable of all the super-adapters including this one.
 int getDepth()
          Return the inheritance depth of the target type: OclAny is at depth 0.
 DomainFragment getFragment(int fragmentNumber)
           
protected  DomainFragment[] getFragments()
           
 int getIndex(int fragmentNumber)
           
 int getIndexes()
           
protected abstract  java.lang.Iterable<? extends DomainInheritance> getInitialSuperInheritances()
          Return the immediate superinheritances without reference to the fragments.
 DomainFragment getSelfFragment()
           
 AbstractInheritance.FragmentIterable getSuperFragments(int depth)
          Return an Iterable of all the super-inheritances at a specified depth, between 0 and getDepth() inclusive.
 DomainType getType()
           
 TypeId getTypeId()
          Return a unique StandardLibrary-independent identifier for this type.
protected  void initialize()
           
 boolean install()
          Install this Inheritance establishing its superClass tables and registering it to be notified of any changes.
protected  void installOclAny()
          Install the root OclAny Inheritance.
 boolean isInstallable()
          Return true if this is installed or able to be installed.
 boolean isInstalled()
          Return true if this is installed.
 void removeSubInheritance(ReflectiveType subInheritance)
           
 void uninstall()
           
 
Methods inherited from class org.eclipse.ocl.examples.domain.types.AbstractInheritance
conformsTo, getCommonInheritance, getCommonType, getFragment, getInheritance, getMemberOperation, getName, getNormalizedType, getOclAnyInheritance, getOwnedInvariant, getOwnedRule, getPackage, initStatics, isEqualTo, isEqualToUnspecializedType, isInvalid, isOrdered, isSubInheritanceOf, isSuperInheritanceOf, isUndefined, isUnique, lookupImplementation, lookupLocalOperation, oclEquals, oclHashCode, specializeIn, 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, getMemberProperty, getStandardLibrary
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainType
getLocalOperations, getLocalProperties, getLocalSuperTypes, getMetaTypeName, getOwnedAttribute, getOwnedOperation, getTypeParameters
 

Constructor Detail

ReflectiveType

public ReflectiveType(@NonNull
                      java.lang.String name,
                      @NonNull
                      ExecutorPackage evaluationPackage,
                      int flags,
                      ExecutorTypeParameter... typeParameters)
Method Detail

computeFlags

protected static int computeFlags(@NonNull
                                  DomainType type)

addSubInheritance

public void addSubInheritance(@NonNull
                              ReflectiveType subInheritance)

createFragment

protected abstract AbstractFragment createFragment(@NonNull
                                                   DomainInheritance baseInheritance)

createInstance

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


createInstance

@Nullable
public java.lang.Object createInstance(@NonNull
                                                java.lang.String value)
Description copied from interface: DomainType
Return a new instance of this data type from valueFactory.

Parameters:
value - string initial value

dispose

public void dispose()

gatherUninstalledInheritances

public boolean gatherUninstalledInheritances(@NonNull
                                             java.util.List<ReflectiveType> inheritances)
Add this Inheritance and all un-installed super-Inheritances to inheritances, returning true if this inheritance was already installed.


getAllSuperFragments

@NonNull
public final AbstractInheritance.FragmentIterable getAllSuperFragments()
Description copied from interface: DomainInheritance
Return a depth ordered, OclAny-first, OclSelf-last, Iterable of all the super-adapters including this one.


getDepth

public final int getDepth()
Description copied from interface: DomainInheritance
Return the inheritance depth of the target type: OclAny is at depth 0.


getFragment

public DomainFragment getFragment(int fragmentNumber)

getFragments

@NonNull
protected DomainFragment[] getFragments()

getIndex

public int getIndex(int fragmentNumber)

getIndexes

public int getIndexes()

getInitialSuperInheritances

@NonNull
protected abstract java.lang.Iterable<? extends DomainInheritance> getInitialSuperInheritances()
Return the immediate superinheritances without reference to the fragments.


getSelfFragment

@NonNull
public DomainFragment getSelfFragment()

getSuperFragments

@NonNull
public final AbstractInheritance.FragmentIterable getSuperFragments(int depth)
Description copied from interface: DomainInheritance
Return an Iterable of all the super-inheritances at a specified depth, between 0 and getDepth() inclusive.


getType

@NonNull
public DomainType getType()

getTypeId

@NonNull
public TypeId getTypeId()
Description copied from interface: DomainType
Return a unique StandardLibrary-independent identifier for this type.

Returns:

initialize

protected void initialize()

install

public boolean install()
Install this Inheritance establishing its superClass tables and registering it to be notified of any changes.

Returns:
true if installed, false if some superClass uninstallable

installOclAny

protected final void installOclAny()
Install the root OclAny Inheritance.


isInstallable

public boolean isInstallable()
Return true if this is installed or able to be installed. Returns false if some superclass must be installed first.


isInstalled

public boolean isInstalled()
Return true if this is installed.


removeSubInheritance

public void removeSubInheritance(@NonNull
                                 ReflectiveType subInheritance)

uninstall

public void uninstall()