Class QueryCache
java.lang.Object
net.ssehub.easy.varModel.confModel.QueryCache
- Direct Known Subclasses:
SharedQueryCache
A cache for
ConfigQuerys based on a Configuration. As long the configuration is not recreated,
the cache will store already retrieved values.- Author:
- El-Sharkawy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Configurationprivate Map<IDatatype, List<ConstraintSyntaxTree>> Tuple of (Reference.getType(), possible values for the reference). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedShould only be used for inheritance.(package private)QueryCache(Configuration config) Default constructor for this class, creates an empty cache. -
Method Summary
Modifier and TypeMethodDescription(package private) voidclear()Clears the cache, must be called from the configuration after the configuration was refreshed.getPossibleValues(Reference refType) Calculates possible values (ConstraintSyntaxTree-based) for a givenReferencevariable.
-
Field Details
-
config
-
refValues
Tuple of (Reference.getType(), possible values for the reference).
-
-
Constructor Details
-
QueryCache
protected QueryCache()Should only be used for inheritance. -
QueryCache
QueryCache(Configuration config) Default constructor for this class, creates an empty cache.- Parameters:
config- The configuration for which this cache is used.
-
-
Method Details
-
clear
void clear()Clears the cache, must be called from the configuration after the configuration was refreshed. -
getPossibleValues
Calculates possible values (ConstraintSyntaxTree-based) for a givenReferencevariable.- Parameters:
refType- The reference for which possible values should be calculated for.- Returns:
- A maybe empty list of possible values for the given
Reference. This list is unmodifiable and should not be stored outside of this cache.
-