public class CachedTypeChecker<C,O,P,PM> extends BasicTypeChecker<C,O,P,PM> implements TypeChecker.Cached<C,O,P>
TypeChecker.Cached<C,O,P>
Constructor and Description |
---|
CachedTypeChecker(Environment<?,C,O,P,?,PM,?,?,?,?,?,?> environment) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
exactlyMatches(java.util.List<? extends PM> requiredParameters,
java.util.List<? extends PM> candidateParameters)
Return true if requiredParameters is an exact match for candidateParameters.
|
P |
findAttribute(C owner,
java.lang.String name)
Finds the most specific (re)definition of an attribute in the specified
classifier.
|
protected java.util.List<O> |
getBestMatchingOperations(C owner,
java.lang.String name,
java.util.List<? extends TypedElement<C>> args) |
O |
getDynamicOperation(C dynamicType,
O staticOperation)
Return the operation of dynamicType that exactly match the staticOperation, or null
if there is none or more than one.
|
protected O |
getExactMatchingOperation(java.util.Map<java.lang.String,java.lang.Object> name2operationOrOperations,
O operation)
Return the operation from the name2operationOrOperations cache that matches operation.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getName2OperationOrOperations(C type)
Return the map of name to operator or list of operations for a type.
|
protected java.util.Map<java.lang.String,P> |
getName2Property(C type)
Return the map of name to property for a type.
|
void |
reset()
Reset the cache forcing lazy evaluations to restart.
|
void |
setBypass(boolean bypass)
Reset the cache and define its bypass state.
|
resolve, resolveCollectionType, resolveTupleType
checkMutuallyComparable, commonSuperType, commonSuperType, compatibleTypeMatch, exactTypeMatch, findOperationMatching, findSignalMatching, getAttributes, getEnvironment, getOCLFactory, getOperations, getPropertyType, getRelationship, getRelationship, getResultType, getUMLReflection, isStandardLibraryFeature, matchArgs, matchArgsWithExactitude, resolveGenericSignature, resolveGenericType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkMutuallyComparable, commonSuperType, compatibleTypeMatch, exactTypeMatch, findOperationMatching, findSignalMatching, getAttributes, getOperations, getPropertyType, getRelationship, getResultType, isStandardLibraryFeature, matchArgs, resolveGenericSignature
public CachedTypeChecker(Environment<?,C,O,P,?,PM,?,?,?,?,?,?> environment)
protected boolean exactlyMatches(java.util.List<? extends PM> requiredParameters, java.util.List<? extends PM> candidateParameters)
public P findAttribute(C owner, java.lang.String name)
AbstractTypeChecker
findAttribute
in interface TypeChecker<C,O,P>
findAttribute
in class AbstractTypeChecker<C,O,P,PM>
owner
- the classifier to searchname
- the name of the operationnull
if not foundprotected java.util.List<O> getBestMatchingOperations(C owner, java.lang.String name, java.util.List<? extends TypedElement<C>> args)
getBestMatchingOperations
in class AbstractTypeChecker<C,O,P,PM>
public O getDynamicOperation(C dynamicType, O staticOperation)
getDynamicOperation
in interface TypeChecker.Cached<C,O,P>
protected O getExactMatchingOperation(java.util.Map<java.lang.String,java.lang.Object> name2operationOrOperations, O operation)
name2operationOrOperations
- operation
- protected java.util.Map<java.lang.String,java.lang.Object> getName2OperationOrOperations(C type)
protected java.util.Map<java.lang.String,P> getName2Property(C type)
public void reset()
TypeChecker.Cached
reset
in interface TypeChecker.Cached<C,O,P>
public void setBypass(boolean bypass)
TypeChecker.Cached
setBypass
in interface TypeChecker.Cached<C,O,P>