Class QueryCache
- java.lang.Object
-
- net.ssehub.easy.varModel.confModel.QueryCache
-
- Direct Known Subclasses:
SharedQueryCache
public class QueryCache extends java.lang.ObjectA cache forConfigQuerys based on aConfiguration. As long the configuration is not recreated, the cache will store already retrieved values.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfigprivate java.util.Map<IDatatype,java.util.List<ConstraintSyntaxTree>>refValuesTuple of (Reference.getType(), possible values for the reference).
-
Constructor Summary
Constructors Modifier Constructor Description protectedQueryCache()Should only be used for inheritance.(package private)QueryCache(Configuration config)Default constructor for this class, creates an empty cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclear()Clears the cache, must be called from the configuration after the configuration was refreshed.java.util.List<ConstraintSyntaxTree>getPossibleValues(Reference refType)Calculates possible values (ConstraintSyntaxTree-based) for a givenReferencevariable.
-
-
-
Field Detail
-
config
private Configuration config
-
refValues
private java.util.Map<IDatatype,java.util.List<ConstraintSyntaxTree>> refValues
Tuple of (Reference.getType(), possible values for the reference).
-
-
Constructor Detail
-
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 Detail
-
clear
void clear()
Clears the cache, must be called from the configuration after the configuration was refreshed.
-
getPossibleValues
public java.util.List<ConstraintSyntaxTree> getPossibleValues(Reference refType)
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.
-
-