Class ModelTransformationCache
java.lang.Object
org.palladiosimulator.simulizar.reconfiguration.qvto.util.ModelTransformationCache
This cache implementation is used to store QVTo transformations (in terms of
TransformationData objects) that can be executed by QVTo executors
during reconfigurations. To store a transformation in the cache, its
corresponding URI is used as tag.-
Constructor Summary
ConstructorsConstructorDescriptionModelTransformationCache(URI... initialTransformations) Initializes a new instance of theModelTransformationCacheclass. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the cache, that is, all content is discarded.booleanGets whether the QVTo transformation which the given URI points to, is currently in the cache.Attempts to retrieve the QVTo transformation that is associated with the given URI from the cache.getAll()Gets all the transformations, in terms of the respectiveTransformationDatacurrently stored in this cache.final voidRemoves the QVTo transformations specified by the given URIs from this cache, if present.final voidStores the QVTo transformations specified by the given URIs in the cache.
-
Constructor Details
-
ModelTransformationCache
Initializes a new instance of theModelTransformationCacheclass.- Parameters:
initialTransformations- A set of transformationURIsthat shall be stored in the cache, might be empty.
-
-
Method Details
-
store
Stores the QVTo transformations specified by the given URIs in the cache.- Parameters:
transformationUris- A set ofURIsthat point to QVTo transformations.- Throws:
NullPointerException- In casetransformationUris == null.IllegalArgumentException- In case any of the transformations is already present in the cache.
-
get
Attempts to retrieve the QVTo transformation that is associated with the given URI from the cache.- Parameters:
transformationUri- AURIthat points to a QVTo transformation.- Returns:
- The
TransformationDataof the transformation, ornullif it is not present in the cache. - Throws:
NullPointerException- In case the given URI isnull.- See Also:
-
remove
Removes the QVTo transformations specified by the given URIs from this cache, if present.- Parameters:
transformationUris- A set ofURIsthat point to QVTo transformations.- Throws:
NullPointerException- In case any of the given uris isnull.
-
contains
Gets whether the QVTo transformation which the given URI points to, is currently in the cache.- Parameters:
transformationUri- AURIthat points to a QVTo transformation.- Returns:
true, iff the transformation is stored,falseotherwise- Throws:
NullPointerException- In case the given URI isnull.
-
getAll
Gets all the transformations, in terms of the respectiveTransformationDatacurrently stored in this cache.- Returns:
- An
Iterableof all the stored transformations.
-
clear
public void clear()Clears the cache, that is, all content is discarded.
-