Class ModelTransformationCache

java.lang.Object
org.palladiosimulator.simulizar.reconfiguration.qvto.util.ModelTransformationCache

public class ModelTransformationCache extends Object
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

    Constructors
    Constructor
    Description
    ModelTransformationCache(URI... initialTransformations)
    Initializes a new instance of the ModelTransformationCache class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the cache, that is, all content is discarded.
    boolean
    contains(URI transformationUri)
    Gets whether the QVTo transformation which the given URI points to, is currently in the cache.
    get(URI transformationUri)
    Attempts to retrieve the QVTo transformation that is associated with the given URI from the cache.
    Gets all the transformations, in terms of the respective TransformationData currently stored in this cache.
    final void
    remove(URI... transformationUris)
    Removes the QVTo transformations specified by the given URIs from this cache, if present.
    final void
    store(URI... transformationUris)
    Stores the QVTo transformations specified by the given URIs in the cache.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModelTransformationCache

      @SafeVarargs public ModelTransformationCache(URI... initialTransformations)
      Initializes a new instance of the ModelTransformationCache class.
      Parameters:
      initialTransformations - A set of transformation URIs that shall be stored in the cache, might be empty.
  • Method Details

    • store

      @SafeVarargs public final void store(URI... transformationUris)
      Stores the QVTo transformations specified by the given URIs in the cache.
      Parameters:
      transformationUris - A set of URIs that point to QVTo transformations.
      Throws:
      NullPointerException - In case transformationUris == null.
      IllegalArgumentException - In case any of the transformations is already present in the cache.
    • get

      public Optional<QvtoModelTransformation> get(URI transformationUri)
      Attempts to retrieve the QVTo transformation that is associated with the given URI from the cache.
      Parameters:
      transformationUri - A URI that points to a QVTo transformation.
      Returns:
      The TransformationData of the transformation, or null if it is not present in the cache.
      Throws:
      NullPointerException - In case the given URI is null.
      See Also:
    • remove

      @SafeVarargs public final void remove(URI... transformationUris)
      Removes the QVTo transformations specified by the given URIs from this cache, if present.
      Parameters:
      transformationUris - A set of URIs that point to QVTo transformations.
      Throws:
      NullPointerException - In case any of the given uris is null.
    • contains

      public boolean contains(URI transformationUri)
      Gets whether the QVTo transformation which the given URI points to, is currently in the cache.
      Parameters:
      transformationUri - A URI that points to a QVTo transformation.
      Returns:
      true, iff the transformation is stored, false otherwise
      Throws:
      NullPointerException - In case the given URI is null.
    • getAll

      Gets all the transformations, in terms of the respective TransformationData currently stored in this cache.
      Returns:
      An Iterable of all the stored transformations.
    • clear

      public void clear()
      Clears the cache, that is, all content is discarded.