public abstract class CachedModel<ModelElementType> extends Model
Map.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allContentsAreCached |
protected Collection<ModelElementType> |
allContentsCache |
protected List<Object> |
cachedKinds |
protected List<Object> |
cachedTypes |
protected boolean |
cachingEnabled |
protected Multimap<Object,ModelElementType> |
kindCache |
static String |
PROPERTY_CACHED |
protected Multimap<Object,ModelElementType> |
typeCache |
aliases, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_STOREONDISPOSAL, readOnLoad, storeOnDisposal| Constructor and Description |
|---|
CachedModel() |
| Modifier and Type | Method and Description |
|---|---|
Collection<ModelElementType> |
allContents()
Returns a collection containing all of the objects contained in
this model.
|
protected abstract Collection<? extends ModelElementType> |
allContentsFromModel() |
void |
clearCache() |
ModelElementType |
createInstance(String type) |
protected abstract ModelElementType |
createInstanceInModel(String type) |
void |
deleteElement(Object o) |
protected abstract boolean |
deleteElementInModel(Object instance)
Returns true iff the given instance was deleted from the model.
|
void |
dispose() |
protected abstract void |
disposeModel() |
Collection<ModelElementType> |
getAllOfKind(String kind) |
protected abstract Collection<? extends ModelElementType> |
getAllOfKindFromModel(String kind) |
Collection<ModelElementType> |
getAllOfType(String type) |
protected abstract Collection<? extends ModelElementType> |
getAllOfTypeFromModel(String type) |
protected abstract Collection<String> |
getAllTypeNamesOf(Object instance)
Returns the names of every type to which the
given object conforms.
|
protected abstract Object |
getCacheKeyForType(String type)
Returns an identity for the given type,
which will be used by
CachedModel
as a key for the memoization of model elements
by type. |
boolean |
isCachingEnabled() |
void |
load() |
void |
load(StringProperties properties,
IRelativePathResolver resolver) |
protected abstract void |
loadModel() |
void |
setCachingEnabled(boolean cachingEnabled) |
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeOf, isModelElement, isOfKind, isOfType, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposalclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetElementById, getElementId, getEnumerationValue, getTypeNameOf, hasType, isInstantiable, owns, setElementId, store, storepublic static String PROPERTY_CACHED
protected Collection<ModelElementType> allContentsCache
protected boolean allContentsAreCached
protected Multimap<Object,ModelElementType> typeCache
protected Multimap<Object,ModelElementType> kindCache
protected boolean cachingEnabled
protected abstract Collection<? extends ModelElementType> allContentsFromModel()
protected abstract Collection<? extends ModelElementType> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException
protected abstract Collection<? extends ModelElementType> getAllOfKindFromModel(String kind) throws EolModelElementTypeNotFoundException
protected abstract ModelElementType createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
protected abstract void loadModel()
throws EolModelLoadingException
EolModelLoadingExceptionprotected abstract void disposeModel()
protected abstract boolean deleteElementInModel(Object instance) throws EolRuntimeException
EolRuntimeExceptionprotected abstract Object getCacheKeyForType(String type) throws EolModelElementTypeNotFoundException
CachedModel
as a key for the memoization of model elements
by type.protected abstract Collection<String> getAllTypeNamesOf(Object instance)
CachedModel for the memoization of
model elements by their kind (getAllOfKind(String)).public void setCachingEnabled(boolean cachingEnabled)
public boolean isCachingEnabled()
public Collection<ModelElementType> allContents()
IModelpublic Collection<ModelElementType> getAllOfType(String type) throws EolModelElementTypeNotFoundException
public Collection<ModelElementType> getAllOfKind(String kind) throws EolModelElementTypeNotFoundException
public ModelElementType createInstance(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
public void deleteElement(Object o) throws EolRuntimeException
EolRuntimeExceptionpublic void load()
throws EolModelLoadingException
EolModelLoadingExceptionpublic void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException
load in interface IModelload in class ModelEolModelLoadingExceptionpublic void dispose()
public void clearCache()
Copyright © 2016. All rights reserved.