org.eclipse.ocl.examples.pivot.utilities
Class TypeManager

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.utilities.PivotStandardLibrary
      extended by org.eclipse.ocl.examples.pivot.utilities.TypeCaches
          extended by org.eclipse.ocl.examples.pivot.utilities.TypeManager
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, StandardLibrary
Direct Known Subclasses:
OCLConsolePage.CancelableTypeManager

public class TypeManager
extends TypeCaches
implements org.eclipse.emf.common.notify.Adapter

A TypeManager adapts a ResourceSet to provide facilities for the pivot model.

An PivotURI entry is maintained for each non-null EPackage.nsURI to facilitate lookup, detect duplicates, and domain (Ecore/UML - Pivot - CS) mappings.

An PivotPrefix entry is maintained for each non-null EPackage.nsPrefix to facilitate alias generation for monikers.


Nested Class Summary
static interface TypeManager.Factory
           
static class TypeManager.TuplePart
           
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.pivot.utilities.TypeCaches
TypeCaches.CompleteClassOperationsIterable, TypeCaches.CompleteClassPropertiesIterable, TypeCaches.CompleteClassSuperClassesIterable, TypeCaches.CompleteElementConstraintsIterable, TypeCaches.CompletePackagePackagesIterable, TypeCaches.CompletePackageTypesIterable, TypeCaches.OrphanNode
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
protected  org.eclipse.emf.ecore.resource.impl.ResourceSetImpl externalResourceSet
           
protected  java.util.List<Library> pivotLibraries
          All Library packages imported intio the current type managed domain.
protected  org.eclipse.emf.ecore.resource.Resource pivotLibraryResource
          The resource of the first of the pivotLibraries.
protected  org.eclipse.emf.ecore.resource.ResourceSet pivotResourceSet
           
 
Fields inherited from class org.eclipse.ocl.examples.pivot.utilities.TypeCaches
pivotMetaModel
 
Fields inherited from class org.eclipse.ocl.examples.pivot.utilities.PivotStandardLibrary
DEFAULT_OCL_STDLIB_URI, defaultStandardLibraryURI
 
Constructor Summary
TypeManager()
           
TypeManager(org.eclipse.emf.ecore.resource.ResourceSet pivotResourceSet)
           
 
Method Summary
 void addExternalResource(External2Pivot external2Pivot)
           
static void addFactory(TypeManager.Factory factory)
           
 Namespace addGlobalNamespace(java.lang.String name, Namespace namespace)
           
 boolean addGlobalTypes(java.util.Collection<Type> types)
           
 int compareOperationMatches(Operation reference, java.util.Map<TemplateParameter,ParameterableElement> referenceBindings, Operation candidate, java.util.Map<TemplateParameter,ParameterableElement> candidateBindings)
          Return -ve if match1 is inferior to match2, +ve if match2 is inferior to match1, or zero if both matches are of equal validity.
protected  void compilePrecedenceOperation(Operation operation)
           
protected  void compilePrecedencePackage(Package pivotPackage)
           
 java.util.List<java.lang.String> compilePrecedences(java.util.Collection<? extends Package> rootPackages)
          Interleave the ownedPrecedences of the rootPackages to establish a merged ordering and assign the index in that ordering to each rootPackages.ownedPrecedences.
protected  void compilePrecedenceType(Type pivotType)
           
protected  CallableImplementation computeOperationImplementation(Operation operation)
           
 java.util.Collection<Package> computePivotRootPackages()
           
protected  CallableImplementation computePropertyImplementation(Property property)
           
 boolean conformsTo(Type firstType, Type secondType)
          Deprecated. 
 boolean conformsTo(Type firstType, Type secondType, java.util.Map<TemplateParameter,ParameterableElement> bindings)
           
protected  boolean conformsToClassifierType(ClassifierType firstType, ClassifierType secondType, java.util.Map<TemplateParameter,ParameterableElement> bindings)
           
protected  boolean conformsToCollectionType(CollectionType firstType, CollectionType secondType, java.util.Map<TemplateParameter,ParameterableElement> bindings)
           
protected  boolean conformsToLambdaType(LambdaType firstType, LambdaType secondType, java.util.Map<TemplateParameter,ParameterableElement> bindings)
           
protected  boolean conformsToTupleType(TupleType actualType, TupleType requiredType, java.util.Map<TemplateParameter,ParameterableElement> bindings)
           
 InvalidLiteralExp createInvalidExpression()
           
protected  org.eclipse.emf.ecore.resource.Resource createOrphanage(org.eclipse.emf.common.util.URI uri)
           
<T extends Package>
T
createPackage(java.lang.Class<T> pivotClass, org.eclipse.emf.ecore.EClass pivotEClass, java.lang.String name, java.lang.String nsURI)
           
 Package createPackage(java.lang.String string, java.lang.String nsURI)
           
 org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.emf.common.util.URI uri, java.lang.String contentType)
           
 UnspecifiedType createUnspecifiedType()
           
 void dispose()
           
static TypeManager findAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
           
static TypeManager getAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
           
 ClassifierType getClassifierType(Type type)
           
 CollectionType getCollectionType(boolean isOrdered, boolean isUnique)
           
 CollectionType getCollectionType(boolean isOrdered, boolean isUnique, Type elementType)
           
 Type getCollectionType(java.lang.String collectionTypeName, Type elementType)
           
 java.util.List<Class> getCommonClasses(Class leftClass, Class rightClass)
           
 Type getCommonTupleType(TupleType leftType, TupleType rightType, java.util.Map<TemplateParameter,ParameterableElement> bindings)
           
 Type getCommonType(Type leftType, Type rightType)
          Deprecated. 
 Type getCommonType(Type leftType, Type rightType, java.util.Map<TemplateParameter,ParameterableElement> templateParameterSubstitutions)
           
 java.lang.String getDefaultStandardLibraryURI()
          Return the CompleteEnvironmentManager, which is null if none yet created.
 org.eclipse.emf.ecore.resource.ResourceSet getExternalResourceSet()
           
 java.util.Set<java.util.Map.Entry<java.lang.String,Namespace>> getGlobalNamespaces()
           
 java.lang.Iterable<Type> getGlobalTypes()
           
 CallableImplementation getImplementation(Feature feature)
          Return the implementation of a feature.
 CallableImplementation getImplementation(Operation operation)
           
 CallableImplementation getImplementation(Property property)
           
 Precedence getInfixPrecedence(java.lang.String operatorName)
           
 LambdaType getLambdaType(java.lang.String typeName, Type contextType, java.util.List<? extends Type> parameterTypes, Type resultType, java.util.Map<TemplateParameter,ParameterableElement> bindings, java.lang.String moniker)
           
 java.util.List<Library> getLibraries()
           
 org.eclipse.emf.ecore.resource.Resource getLibraryResource()
           
 Type getLibraryType(java.lang.String string, java.util.List<? extends ParameterableElement> templateArguments)
           
<T extends Type>
T
getLibraryType(T libraryType, java.util.List<? extends ParameterableElement> templateArguments, boolean resolveSuperClasses)
           
 Package getPivotMetaModel()
           
<T extends NamedElement>
T
getPivotOfEcore(java.lang.Class<T> pivotClass, org.eclipse.emf.ecore.EObject eObject)
           
 org.eclipse.emf.ecore.resource.ResourceSet getPivotResourceSet()
           
 Type getPivotType(java.lang.String className)
          Return the pivot model class for className with the Pivot Model.
 java.lang.Iterable<? extends Nameable> getPrecedences(Package pivotPackage)
           
 Precedence getPrefixPrecedence(java.lang.String operatorName)
           
 org.eclipse.emf.common.util.URI getResourceIdentifier(java.lang.Object uniqueContext, java.lang.String subContext)
          Return the URI to be used for a concrete syntax resource for an expression associated with a uniqueContext.
 CollectionType getSetType(Type elementType)
           
protected  Type getSpecializedLambdaType(LambdaType type, java.util.Map<TemplateParameter,ParameterableElement> usageBindings)
           
protected  java.lang.String getSpecializedMoniker(Type libraryType, java.util.List<? extends ParameterableElement> templateArguments)
           
<T extends Operation>
T
getSpecializedOperation(T unspecializedOperation, java.util.Map<TemplateParameter,ParameterableElement> templateBindings)
           
protected  java.lang.String getSpecializedOperationMoniker(Operation operation, java.util.List<? extends ParameterableElement> templateArguments, java.util.Map<TemplateParameter,ParameterableElement> templateBindings)
           
protected  Type getSpecializedTupleType(TupleType type, java.util.Map<TemplateParameter,ParameterableElement> usageBindings)
           
protected  Type getSpecializedType(Type type, java.util.Map<TemplateParameter,ParameterableElement> usageBindings)
           
 org.eclipse.emf.ecore.resource.ResourceSet getTarget()
           
 TupleType getTupleType(java.lang.String typeName, java.util.Collection<? extends TypedElement> parts, java.util.Map<TemplateParameter,ParameterableElement> bindings, java.lang.String moniker)
          Creates a new tuple instance.
 Type getTypeWithMultiplicity(TypedMultiplicityElement element)
           
 ValueFactory getValueFactory()
           
static void initializePivotResourceSet(org.eclipse.emf.ecore.resource.ResourceSet pivotResourceSet)
           
protected  void installLibrary(Library pivotLibrary)
           
 void installPackage(Package pivotPackage)
           
 void installResource(org.eclipse.emf.ecore.resource.Resource pivotResource)
           
 boolean isAdapterForType(java.lang.Object type)
           
static boolean isLibraryType(Type type)
           
 boolean isSuperClassOf(Type unspecializedFirstType, Class secondType)
           
 boolean isUnderspecified(ParameterableElement type)
          Retyurn true if this type involves an UnspecifiedType.
protected  boolean isUnspecialized(java.util.List<TemplateParameter> templateParameters, java.util.List<? extends ParameterableElement> templateArguments)
           
protected  void lazyLoadPivotMetaModel()
           
protected  org.eclipse.emf.ecore.resource.Resource loadDefaultLibrary(java.lang.String uri)
           
 void loadLibrary(org.eclipse.emf.ecore.resource.Resource pivotResource)
           
protected  void loadLibraryPackage(Package pivotPackage)
           
 Element loadResource(org.eclipse.emf.common.util.URI uri, java.lang.String alias)
           
 void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
           
 java.util.Set<Operation> resolveLocalOperation(Class pivotClass, java.lang.String operationName, Type... pivotArguments)
          Add a resource-specific map of elements to preferred aliases, updating the internal pivot-resource-set-wide map of elements to pivot-aliases and vice-versa.
 Operation resolveOperation(Type leftType, java.lang.String operationName, Type... rightTypes)
           
 java.util.Set<Operation> resolveOperations(Class pivotClass, java.lang.String operationName, Type... pivotArguments)
           
 void resolveSpecializationBaseClasses()
           
 void resolveSuperClasses(Class specializedClass)
          Update a specializedClass so that its superclasses correspond to the specializations of the specializations of the superclasses of the class that specializedClass specializes.
 void resolveSuperClasses(Class specializedClass, Class libraryClass, java.util.Map<TemplateParameter,ParameterableElement> allBindings)
           
 void setDefaultStandardLibraryURI(java.lang.String defaultStandardLibraryURI)
           
static void setMonikerAsID(java.util.Collection<? extends org.eclipse.emf.ecore.resource.Resource> resources)
          Install the moniker of each nameable pivot element as its xmi:id.
 void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
           
 
Methods inherited from class org.eclipse.ocl.examples.pivot.utilities.TypeCaches
addOrphanClass, addOrphanOperation, addPackage, computeMoniker2PivotMap, findOrphanClass, findOrphanOperation, getAllClasses, getAllConstraints, getAllConstraints, getAllOperations, getAllPackages, getAllPackages, getAllProperties, getDynamicOperation, getLocalClasses, getLocalConstraints, getLocalConstraints, getLocalConstraints, getLocalOperations, getLocalPackages, getLocalProperties, getOrphanClass, getOrphanPackage, getPackageMoniker, getPrimaryClass, getPrimaryClass, getPrimaryElement, getPrimaryOperation, getPrimaryOperation, getPrimaryPackage, getPrimaryPackage, getPrimaryProperty, getSuperClasses, installPackageMoniker, installPropertyDeclaration, isInOrphanage, loadPivotMetaModel
 
Methods inherited from class org.eclipse.ocl.examples.pivot.utilities.PivotStandardLibrary
defineLibraryType, getBagType, getBooleanType, getClassifierType, getCollectionType, getEnumerationType, getIntegerType, getLibraryType, getOclAnyType, getOclInvalidType, getOclMessageType, getOclVoidType, getOrderedSetType, getRealType, getRequiredLibraryType, getSequenceType, getSetType, getStringType, getTupleType, getUnlimitedNaturalType, isOrdered, isUnique, resetLibrary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pivotResourceSet

protected final org.eclipse.emf.ecore.resource.ResourceSet pivotResourceSet

pivotLibraries

protected java.util.List<Library> pivotLibraries
All Library packages imported intio the current type managed domain. All libraries share the same URI, which for supplementary libraries may be null.


pivotLibraryResource

protected org.eclipse.emf.ecore.resource.Resource pivotLibraryResource
The resource of the first of the pivotLibraries. Set once actually loaded.


externalResourceSet

protected org.eclipse.emf.ecore.resource.impl.ResourceSetImpl externalResourceSet
Constructor Detail

TypeManager

public TypeManager()

TypeManager

public TypeManager(org.eclipse.emf.ecore.resource.ResourceSet pivotResourceSet)
Method Detail

addFactory

public static void addFactory(TypeManager.Factory factory)

findAdapter

public static TypeManager findAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)

getAdapter

public static TypeManager getAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)

initializePivotResourceSet

public static void initializePivotResourceSet(org.eclipse.emf.ecore.resource.ResourceSet pivotResourceSet)

isLibraryType

public static boolean isLibraryType(Type type)

setMonikerAsID

public static void setMonikerAsID(java.util.Collection<? extends org.eclipse.emf.ecore.resource.Resource> resources)
Install the moniker of each nameable pivot element as its xmi:id.

Parameters:
pivotResources -

addExternalResource

public void addExternalResource(External2Pivot external2Pivot)

addGlobalNamespace

public Namespace addGlobalNamespace(java.lang.String name,
                                    Namespace namespace)

addGlobalTypes

public boolean addGlobalTypes(java.util.Collection<Type> types)

compareOperationMatches

public int compareOperationMatches(Operation reference,
                                   java.util.Map<TemplateParameter,ParameterableElement> referenceBindings,
                                   Operation candidate,
                                   java.util.Map<TemplateParameter,ParameterableElement> candidateBindings)
Return -ve if match1 is inferior to match2, +ve if match2 is inferior to match1, or zero if both matches are of equal validity.


compilePrecedences

public java.util.List<java.lang.String> compilePrecedences(java.util.Collection<? extends Package> rootPackages)
Interleave the ownedPrecedences of the rootPackages to establish a merged ordering and assign the index in that ordering to each rootPackages.ownedPrecedences. Any inconsistent ordering and associativity is diagnosed.


compilePrecedenceOperation

protected void compilePrecedenceOperation(Operation operation)

compilePrecedencePackage

protected void compilePrecedencePackage(Package pivotPackage)

compilePrecedenceType

protected void compilePrecedenceType(Type pivotType)

computeOperationImplementation

protected CallableImplementation computeOperationImplementation(Operation operation)
                                                         throws java.lang.ClassNotFoundException,
                                                                java.lang.SecurityException,
                                                                java.lang.NoSuchFieldException,
                                                                java.lang.IllegalArgumentException,
                                                                java.lang.IllegalAccessException
Throws:
java.lang.ClassNotFoundException
java.lang.SecurityException
java.lang.NoSuchFieldException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException

computePivotRootPackages

public java.util.Collection<Package> computePivotRootPackages()

computePropertyImplementation

protected CallableImplementation computePropertyImplementation(Property property)
                                                        throws java.lang.ClassNotFoundException,
                                                               java.lang.SecurityException,
                                                               java.lang.NoSuchFieldException,
                                                               java.lang.IllegalArgumentException,
                                                               java.lang.IllegalAccessException
Throws:
java.lang.ClassNotFoundException
java.lang.SecurityException
java.lang.NoSuchFieldException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException

conformsTo

@Deprecated
public boolean conformsTo(Type firstType,
                                     Type secondType)
Deprecated. 

Specified by:
conformsTo in interface StandardLibrary

conformsTo

public boolean conformsTo(Type firstType,
                          Type secondType,
                          java.util.Map<TemplateParameter,ParameterableElement> bindings)
Specified by:
conformsTo in interface StandardLibrary

conformsToClassifierType

protected boolean conformsToClassifierType(ClassifierType firstType,
                                           ClassifierType secondType,
                                           java.util.Map<TemplateParameter,ParameterableElement> bindings)

conformsToLambdaType

protected boolean conformsToLambdaType(LambdaType firstType,
                                       LambdaType secondType,
                                       java.util.Map<TemplateParameter,ParameterableElement> bindings)

conformsToCollectionType

protected boolean conformsToCollectionType(CollectionType firstType,
                                           CollectionType secondType,
                                           java.util.Map<TemplateParameter,ParameterableElement> bindings)

conformsToTupleType

protected boolean conformsToTupleType(TupleType actualType,
                                      TupleType requiredType,
                                      java.util.Map<TemplateParameter,ParameterableElement> bindings)

createInvalidExpression

public InvalidLiteralExp createInvalidExpression()

createOrphanage

protected org.eclipse.emf.ecore.resource.Resource createOrphanage(org.eclipse.emf.common.util.URI uri)
Specified by:
createOrphanage in class TypeCaches

createPackage

public Package createPackage(java.lang.String string,
                             java.lang.String nsURI)

createPackage

public <T extends Package> T createPackage(java.lang.Class<T> pivotClass,
                                           org.eclipse.emf.ecore.EClass pivotEClass,
                                           java.lang.String name,
                                           java.lang.String nsURI)

createResource

public org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.emf.common.util.URI uri,
                                                              java.lang.String contentType)

createUnspecifiedType

public UnspecifiedType createUnspecifiedType()

dispose

public void dispose()
Overrides:
dispose in class TypeCaches

getClassifierType

public ClassifierType getClassifierType(Type type)

getCollectionType

public CollectionType getCollectionType(boolean isOrdered,
                                        boolean isUnique)

getCollectionType

public CollectionType getCollectionType(boolean isOrdered,
                                        boolean isUnique,
                                        Type elementType)

getCollectionType

public Type getCollectionType(java.lang.String collectionTypeName,
                              Type elementType)

getCommonClasses

public java.util.List<Class> getCommonClasses(Class leftClass,
                                              Class rightClass)

getCommonTupleType

public Type getCommonTupleType(TupleType leftType,
                               TupleType rightType,
                               java.util.Map<TemplateParameter,ParameterableElement> bindings)

getCommonType

@Deprecated
public Type getCommonType(Type leftType,
                                     Type rightType)
Deprecated. 


getCommonType

public Type getCommonType(Type leftType,
                          Type rightType,
                          java.util.Map<TemplateParameter,ParameterableElement> templateParameterSubstitutions)

getDefaultStandardLibraryURI

public java.lang.String getDefaultStandardLibraryURI()
Return the CompleteEnvironmentManager, which is null if none yet created. Invoke useCompleteEnvironmentManager to create one when required.


getExternalResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getExternalResourceSet()

getGlobalNamespaces

public java.util.Set<java.util.Map.Entry<java.lang.String,Namespace>> getGlobalNamespaces()

getGlobalTypes

public java.lang.Iterable<Type> getGlobalTypes()

getImplementation

public CallableImplementation getImplementation(Feature feature)
                                         throws java.lang.ClassNotFoundException,
                                                java.lang.SecurityException,
                                                java.lang.NoSuchFieldException,
                                                java.lang.IllegalArgumentException,
                                                java.lang.IllegalAccessException
Return the implementation of a feature.

Parameters:
feature - to be implemented.
Returns:
the implementation, or null if the feature has no implementation as is the case for a normal model feature
Throws:
java.lang.ClassNotFoundException - if the implementation class realising the implementation is not loadable
java.lang.NoSuchFieldException - if the implementation class realising the implementation does not provide a static INSTANCE field
java.lang.SecurityException - if the implementation class is not accessible
java.lang.IllegalAccessException - if the implementation class is not accessible
java.lang.IllegalArgumentException - if the implementation class is not accessible

getImplementation

public CallableImplementation getImplementation(Operation operation)
                                         throws java.lang.ClassNotFoundException,
                                                java.lang.SecurityException,
                                                java.lang.NoSuchFieldException,
                                                java.lang.IllegalArgumentException,
                                                java.lang.IllegalAccessException
Throws:
java.lang.ClassNotFoundException
java.lang.SecurityException
java.lang.NoSuchFieldException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException

getImplementation

public CallableImplementation getImplementation(Property property)
                                         throws java.lang.ClassNotFoundException,
                                                java.lang.SecurityException,
                                                java.lang.NoSuchFieldException,
                                                java.lang.IllegalArgumentException,
                                                java.lang.IllegalAccessException
Throws:
java.lang.ClassNotFoundException
java.lang.SecurityException
java.lang.NoSuchFieldException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException

getInfixPrecedence

public Precedence getInfixPrecedence(java.lang.String operatorName)

getLambdaType

public LambdaType getLambdaType(java.lang.String typeName,
                                Type contextType,
                                java.util.List<? extends Type> parameterTypes,
                                Type resultType,
                                java.util.Map<TemplateParameter,ParameterableElement> bindings,
                                java.lang.String moniker)

getLibraries

public java.util.List<Library> getLibraries()

getLibraryResource

public org.eclipse.emf.ecore.resource.Resource getLibraryResource()

getLibraryType

public Type getLibraryType(java.lang.String string,
                           java.util.List<? extends ParameterableElement> templateArguments)

getLibraryType

public <T extends Type> T getLibraryType(T libraryType,
                                         java.util.List<? extends ParameterableElement> templateArguments,
                                         boolean resolveSuperClasses)

getPivotMetaModel

public Package getPivotMetaModel()

getPivotOfEcore

public <T extends NamedElement> T getPivotOfEcore(java.lang.Class<T> pivotClass,
                                                  org.eclipse.emf.ecore.EObject eObject)

getPivotResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getPivotResourceSet()

getPivotType

public Type getPivotType(java.lang.String className)
Return the pivot model class for className with the Pivot Model.

Specified by:
getPivotType in interface StandardLibrary

getPrecedences

public java.lang.Iterable<? extends Nameable> getPrecedences(Package pivotPackage)

getPrefixPrecedence

public Precedence getPrefixPrecedence(java.lang.String operatorName)

getResourceIdentifier

public org.eclipse.emf.common.util.URI getResourceIdentifier(java.lang.Object uniqueContext,
                                                             java.lang.String subContext)
Return the URI to be used for a concrete syntax resource for an expression associated with a uniqueContext. If uniqueContext is a MonikeredElement the moniker is used as part of the URI, otherwise a unique value is created and cached for reuse.


getSetType

public CollectionType getSetType(Type elementType)

getSpecializedMoniker

protected java.lang.String getSpecializedMoniker(Type libraryType,
                                                 java.util.List<? extends ParameterableElement> templateArguments)

getSpecializedOperation

public <T extends Operation> T getSpecializedOperation(T unspecializedOperation,
                                                       java.util.Map<TemplateParameter,ParameterableElement> templateBindings)

getSpecializedOperationMoniker

protected java.lang.String getSpecializedOperationMoniker(Operation operation,
                                                          java.util.List<? extends ParameterableElement> templateArguments,
                                                          java.util.Map<TemplateParameter,ParameterableElement> templateBindings)

getSpecializedType

protected Type getSpecializedType(Type type,
                                  java.util.Map<TemplateParameter,ParameterableElement> usageBindings)
Specified by:
getSpecializedType in class TypeCaches

getSpecializedLambdaType

protected Type getSpecializedLambdaType(LambdaType type,
                                        java.util.Map<TemplateParameter,ParameterableElement> usageBindings)

getSpecializedTupleType

protected Type getSpecializedTupleType(TupleType type,
                                       java.util.Map<TemplateParameter,ParameterableElement> usageBindings)

getTarget

public org.eclipse.emf.ecore.resource.ResourceSet getTarget()
Specified by:
getTarget in interface org.eclipse.emf.common.notify.Adapter

getTupleType

public TupleType getTupleType(java.lang.String typeName,
                              java.util.Collection<? extends TypedElement> parts,
                              java.util.Map<TemplateParameter,ParameterableElement> bindings,
                              java.lang.String moniker)
Creates a new tuple instance.

Parameters:
type - the type (a TupleType) of the tuple to be created
values - a mapping of the tuple parts
Returns:
the new tuple instance

getTypeWithMultiplicity

public Type getTypeWithMultiplicity(TypedMultiplicityElement element)

getValueFactory

public ValueFactory getValueFactory()

installLibrary

protected void installLibrary(Library pivotLibrary)

installPackage

public void installPackage(Package pivotPackage)

installResource

public void installResource(org.eclipse.emf.ecore.resource.Resource pivotResource)
Specified by:
installResource in class TypeCaches

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)
Specified by:
isAdapterForType in interface org.eclipse.emf.common.notify.Adapter

isSuperClassOf

public boolean isSuperClassOf(Type unspecializedFirstType,
                              Class secondType)

isUnderspecified

public boolean isUnderspecified(ParameterableElement type)
Retyurn true if this type involves an UnspecifiedType.


isUnspecialized

protected boolean isUnspecialized(java.util.List<TemplateParameter> templateParameters,
                                  java.util.List<? extends ParameterableElement> templateArguments)

lazyLoadPivotMetaModel

protected void lazyLoadPivotMetaModel()
Specified by:
lazyLoadPivotMetaModel in class TypeCaches

loadDefaultLibrary

protected org.eclipse.emf.ecore.resource.Resource loadDefaultLibrary(java.lang.String uri)
Specified by:
loadDefaultLibrary in class PivotStandardLibrary

loadLibrary

public void loadLibrary(org.eclipse.emf.ecore.resource.Resource pivotResource)

loadLibraryPackage

protected void loadLibraryPackage(Package pivotPackage)

loadResource

public Element loadResource(org.eclipse.emf.common.util.URI uri,
                            java.lang.String alias)

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
Specified by:
notifyChanged in interface org.eclipse.emf.common.notify.Adapter

resolveSpecializationBaseClasses

public void resolveSpecializationBaseClasses()

resolveSuperClasses

public void resolveSuperClasses(Class specializedClass)
Update a specializedClass so that its superclasses correspond to the specializations of the specializations of the superclasses of the class that specializedClass specializes.

Parameters:
specializedClass - to update superclasses of

resolveSuperClasses

public void resolveSuperClasses(Class specializedClass,
                                Class libraryClass,
                                java.util.Map<TemplateParameter,ParameterableElement> allBindings)

resolveOperation

public Operation resolveOperation(Type leftType,
                                  java.lang.String operationName,
                                  Type... rightTypes)

resolveOperations

public java.util.Set<Operation> resolveOperations(Class pivotClass,
                                                  java.lang.String operationName,
                                                  Type... pivotArguments)

resolveLocalOperation

public java.util.Set<Operation> resolveLocalOperation(Class pivotClass,
                                                      java.lang.String operationName,
                                                      Type... pivotArguments)
Add a resource-specific map of elements to preferred aliases, updating the internal pivot-resource-set-wide map of elements to pivot-aliases and vice-versa. Note that pivot aliases are unique and used only for monikers.

Parameters:
resource -
newAliasMap -
Returns:
public Map putAliasMap(Resource resource, Map newAliasMap) { Map oldAliasMap = aliasMaps.put(resource, newAliasMap); if (oldAliasMap != null) { for (Element key : oldAliasMap.keySet()) { pivot2alias.remove(key); alias2pivot.remove(key); } } if (newAliasMap != null) { for (Element key : newAliasMap.keySet()) { String baseString = newAliasMap.get(key); String alias = PivotConstants.MONIKER_SCOPE_SEPARATOR + baseString; int index = 0; while (alias2pivot.containsKey(alias)) { alias = PivotConstants.MONIKER_SCOPE_SEPARATOR + index++ + PivotConstants.MONIKER_OPERATOR_SEPARATOR + baseString; } pivot2alias.put(key, alias); alias2pivot.put(alias, key); } } return oldAliasMap; }

setDefaultStandardLibraryURI

public void setDefaultStandardLibraryURI(java.lang.String defaultStandardLibraryURI)

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
Specified by:
setTarget in interface org.eclipse.emf.common.notify.Adapter