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

java.lang.Object
  extended by org.eclipse.ocl.examples.library.executor.ExecutorManager
All Implemented Interfaces:
DomainEvaluator
Direct Known Subclasses:
EcoreExecutorManager, PivotExecutorManager

public abstract class ExecutorManager
extends java.lang.Object
implements DomainEvaluator


Field Summary
protected  DomainStandardLibrary standardLibrary
           
 
Constructor Summary
ExecutorManager(DomainStandardLibrary standardLibrary)
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.util.regex.Pattern> createRegexCache()
          Creates (on demand) the regular-expression matcher cache.
 void dispose()
           
 Value evaluate(DomainExpression body)
           
 Value evaluateIteration(DomainType returnType, CollectionValue sourceVal, DomainTypedElement accumulator, DomainExpression body, DomainTypedElement[] iterators)
           
 DomainType getDynamicTypeOf(java.lang.Object value)
           
 DomainEvaluationEnvironment getEvaluationEnvironment()
           
 DomainLogger getLogger()
          Return the logger handling oclLog() invocations or null for none.
 java.util.regex.Pattern getRegexPattern(java.lang.String regex)
          Return a cached matcher for a give regular expression.
 DomainStandardLibrary getStandardLibrary()
           
 DomainType getStaticTypeOf(java.lang.Object value)
           
 DomainType getStaticTypeOf(java.lang.Object value, java.lang.Iterable<?> values)
           
 DomainType getStaticTypeOf(java.lang.Object value, java.lang.Object... values)
           
 boolean isCanceled()
          Return true if the evaluation has been canceled.
 void setCanceled(boolean isCanceled)
          Request cancelation of the current the evaluation, or reset the request for a new evaluation.
 void setLogger(DomainLogger logger)
          Specify the logger to handle oclLog() invocations or null for none.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.evaluation.DomainEvaluator
createNestedEvaluator, getIdResolver, getModelManager
 

Field Detail

standardLibrary

@NonNull
protected final DomainStandardLibrary standardLibrary
Constructor Detail

ExecutorManager

public ExecutorManager(@NonNull
                       DomainStandardLibrary standardLibrary)
Method Detail

createRegexCache

@NonNull
protected java.util.Map<java.lang.String,java.util.regex.Pattern> createRegexCache()
Creates (on demand) the regular-expression matcher cache. The default implementation creates an access-ordered LRU cache with a limit of 16 entries. Subclasses may override to create a map with whatever different performance characteristics may be required.

Returns:
the new regular-expression matcher cache
See Also:
getRegexPattern(String)

dispose

public void dispose()
Specified by:
dispose in interface DomainEvaluator

evaluate

@NonNull
public Value evaluate(@NonNull
                              DomainExpression body)
Specified by:
evaluate in interface DomainEvaluator

evaluateIteration

public Value evaluateIteration(DomainType returnType,
                               CollectionValue sourceVal,
                               DomainTypedElement accumulator,
                               DomainExpression body,
                               DomainTypedElement[] iterators)

getDynamicTypeOf

@NonNull
public DomainType getDynamicTypeOf(@Nullable
                                           java.lang.Object value)

getEvaluationEnvironment

@NonNull
public DomainEvaluationEnvironment getEvaluationEnvironment()
Specified by:
getEvaluationEnvironment in interface DomainEvaluator

getLogger

@Nullable
public DomainLogger getLogger()
Description copied from interface: DomainEvaluator
Return the logger handling oclLog() invocations or null for none.

Specified by:
getLogger in interface DomainEvaluator

getRegexPattern

@NonNull
public java.util.regex.Pattern getRegexPattern(@NonNull
                                                       java.lang.String regex)
Return a cached matcher for a give regular expression.

Specified by:
getRegexPattern in interface DomainEvaluator

getStandardLibrary

@NonNull
public DomainStandardLibrary getStandardLibrary()
Specified by:
getStandardLibrary in interface DomainEvaluator

getStaticTypeOf

@NonNull
public DomainType getStaticTypeOf(@Nullable
                                          java.lang.Object value)
Specified by:
getStaticTypeOf in interface DomainEvaluator

getStaticTypeOf

@NonNull
public DomainType getStaticTypeOf(@Nullable
                                          java.lang.Object value,
                                          @NonNull
                                          java.lang.Object... values)
Specified by:
getStaticTypeOf in interface DomainEvaluator

getStaticTypeOf

@NonNull
public DomainType getStaticTypeOf(@Nullable
                                          java.lang.Object value,
                                          @NonNull
                                          java.lang.Iterable<?> values)
Specified by:
getStaticTypeOf in interface DomainEvaluator

isCanceled

public boolean isCanceled()
Description copied from interface: DomainEvaluator
Return true if the evaluation has been canceled.

Specified by:
isCanceled in interface DomainEvaluator

setCanceled

public void setCanceled(boolean isCanceled)
Description copied from interface: DomainEvaluator
Request cancelation of the current the evaluation, or reset the request for a new evaluation. Cancelation occurs by throwing an EvaluationHaltedException when an expression, operation or iteration is next invoked.

Specified by:
setCanceled in interface DomainEvaluator

setLogger

public void setLogger(@Nullable
                      DomainLogger logger)
Description copied from interface: DomainEvaluator
Specify the logger to handle oclLog() invocations or null for none.

Specified by:
setLogger in interface DomainEvaluator