public final class TypeCache
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
TypeCache.ConstraintTemplate
Represents a constraint template with related constraint set to add the constraint to.
|
class |
TypeCache.Entry
Implements a type cache entry.
|
static interface |
TypeCache.IConstraintTarget
Specifies the interface that an object receiving constraints from this class must provide.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<net.ssehub.easy.varModel.model.datatypes.IDatatype,TypeCache.Entry> |
cache |
static boolean |
ENABLED
Globally enables or disables type-caching.
|
(package private) static boolean |
ON_DEMAND_ACCESSORS
Variable-accessor and name-accessor mappings may be transferred back to the current context in
one copy step
false or step-wise and on-demand only true. |
private SubstitutionVisitor |
substVisitor |
| Constructor and Description |
|---|
TypeCache() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(net.ssehub.easy.varModel.model.datatypes.IDatatype type)
Returns whether this type cache contains an entry for
type. |
TypeCache.Entry |
createEntryFor(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
net.ssehub.easy.varModel.model.AbstractVariable var)
Creates a type cache entry.
|
TypeCache.Entry |
get(net.ssehub.easy.varModel.model.datatypes.IDatatype type)
Returns a type cache entry for the given
type. |
boolean |
transferConstraints(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
TypeCache.IConstraintTarget target,
net.ssehub.easy.varModel.confModel.IDecisionVariable register,
net.ssehub.easy.varModel.model.AbstractVariable var)
Transfers collected constraints for
type. |
void |
transferContext(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
java.util.Map<net.ssehub.easy.varModel.model.AbstractVariable,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> varMap,
java.util.Map<java.lang.String,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> nameMap)
Transfers the mappings of the given
context into the cache entry of type. |
void |
transferToContext(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
ContextStack contexts,
net.ssehub.easy.varModel.model.AbstractVariable var)
Transfers all accessors stored in
TypeCache.Entry.varMap into the actual context in contexts by
instantiating them. |
public static final boolean ENABLED
static final boolean ON_DEMAND_ACCESSORS
false or step-wise and on-demand only true. Only active if #ENABLED.private java.util.Map<net.ssehub.easy.varModel.model.datatypes.IDatatype,TypeCache.Entry> cache
private transient SubstitutionVisitor substVisitor
public TypeCache.Entry get(net.ssehub.easy.varModel.model.datatypes.IDatatype type)
type.type - the type to return the cache entry forpublic boolean contains(net.ssehub.easy.varModel.model.datatypes.IDatatype type)
type.type - the type to look fortrue if type is in the cache, false elsepublic TypeCache.Entry createEntryFor(net.ssehub.easy.varModel.model.datatypes.IDatatype type, net.ssehub.easy.varModel.model.AbstractVariable var)
type - the type to create the entry forvar - the template variblepublic boolean transferConstraints(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
TypeCache.IConstraintTarget target,
net.ssehub.easy.varModel.confModel.IDecisionVariable register,
net.ssehub.easy.varModel.model.AbstractVariable var)
type.type - the type to transfer the constraints totarget - the constraint target receiving instantiated constraintsregister - the variable to register new constraints withvar - the variable to replace the template variabletrue for transferred, false elsepublic void transferContext(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
java.util.Map<net.ssehub.easy.varModel.model.AbstractVariable,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> varMap,
java.util.Map<java.lang.String,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> nameMap)
context into the cache entry of type.type - the typevarMap - the variable-accessor mapping (optional, may be null)nameMap - the name-accessor mapping (optional, may be null)public void transferToContext(net.ssehub.easy.varModel.model.datatypes.IDatatype type,
ContextStack contexts,
net.ssehub.easy.varModel.model.AbstractVariable var)
TypeCache.Entry.varMap into the actual context in contexts by
instantiating them.type - the type to transfercontexts - the target contexts (using the actual one)var - the variable to instantiate forCopyright © 2009 - 2018 SSE. All Rights Reserved.