public class QVToModelCache extends Object
EPackage (its meta-model) is used as tag.| Constructor and Description |
|---|
QVToModelCache(IModelAccess modelAccess)
Initializes a new instance of the
QVToModelCache class. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the cache, that is, all models are removed.
|
boolean |
containsModelOfType(EPackage ePackage)
Gets whether a model of the meta-model represented by the given ePackage is currently in
store.
|
Optional<EObject> |
getModelByType(EPackage ePackage)
Gets the currently stored model that is an instance of the meta-model represented by the
given ePackage.
|
void |
removeModel(EObject model)
Removes the given model from the cache, if present.
This method does nothing, if null is passed or the given model is not cached. |
void |
removeModelOfType(EPackage metaModel)
Removes the currently stored model that is an instance of the meta-model represented by the
given ePackage.
In case null is passed, this method does nothing. |
QVToModelCache |
snapshot()
Creates a snapshot of the current state of the cache.
More precisely, this method creates an instance that contains the same models as this one. |
void |
storeModel(EObject modelInstance)
Stores the given model in the cache.
|
void |
storeModelFromBlackboardPartition(String partitionId)
Stores the model found in the partition of the blackboard that is identified by the given id.
|
public QVToModelCache(IModelAccess modelAccess)
QVToModelCache class.modelAccess - An IModelAccess implementation that is used to access the globally
available models such as the PCM models.NullPointerException - In case modelAccess == null.IModelAccess.getBlackboard(),
IModelAccess.getGlobalPCMModel()public void storeModel(EObject modelInstance)
EPackage that corresponds to the model) is already present, it will be
overwritten. null is passed, this method does nothing.modelInstance - An EObject representing a model.public final void storeModelFromBlackboardPartition(String partitionId)
EPackage that
corresponds to the model) is already present, it will be overwritten.partitionId - A String which identifies a ResourceSetPartition of the the global
MDSDBlackboard.NullPointerException - In case partitionId == null.storeModel(EObject)public void removeModelOfType(EPackage metaModel)
null is passed, this method does nothing.ePackage - An EPackage that describes a meta-model.public void removeModel(EObject model)
null is passed or the given model is not cached.model - The EObject to remove from the cache.public void clear()
public QVToModelCache snapshot()
QVToModelCache which is a snapshot of the current state of this instance.public Optional<EObject> getModelByType(EPackage ePackage)
ePackage - An EPackage that describes a meta-model.Optional and represented as an EObject,
that is an instance of the given meta-model, or an empty Optional if none
could be found.NullPointerException - In case ePackage == null.public boolean containsModelOfType(EPackage ePackage)
ePackage - An EPackage that describes a meta-model.true if a model of the given type is stored, false otherwise.NullPointerException - In case ePackage == null.getModelByType(EPackage)