public class DirectWriteMapDbIndicesStore extends DirectWriteMapDbStore
DirectWriteMapDbStore that persists Collection indices instead of serialized arrays.
Indices are persisted with dedicated FeatureKeys containing the index of the element to
store. Using this approach avoid to deserialize entire Collections to retrieve a single
element, which can be an important bottleneck in terms of execution time and memory consumption
if the underlying model contains very large Collections.
This class re-implements EStructuralFeature accessors and mutators as well as Collection
operations such as size, clear, or indexOf.
This store can be used as a base store that can be complemented by plugging decorator stores on top of it
(see AbstractPersistentStoreDecorator subclasses) to provide additional features such as caching or logging.
DEFAULT_CACHE_SIZE, persistentObjectsCachebackendNO_INDEX| Constructor and Description |
|---|
DirectWriteMapDbIndicesStore(Resource.Internal resource,
MapDbPersistenceBackend backend)
Constructs a new
DirectWriteMapDbIndicesStore between the given resource and the
backend. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(InternalEObject internalObject,
EStructuralFeature feature,
int index,
Object value)
Adds the value at the index in the
content of the object's feature. |
void |
clear(InternalEObject internalObject,
EStructuralFeature feature)
Removes all values form the
content of the object's feature |
protected Object |
getAttribute(PersistentEObject object,
EAttribute attribute,
int index)
Returns the value at the
index in the content of the attribute of the object. |
protected Object |
getReference(PersistentEObject object,
EReference reference,
int index)
Returns the value at the
index in the content of the reference of the object. |
int |
indexOf(InternalEObject internalObject,
EStructuralFeature feature,
Object value)
Returns the first index of the given value in the
content of the object's feature. |
int |
lastIndexOf(InternalEObject internalObject,
EStructuralFeature feature,
Object value)
Returns the last index of the given value in the
content of the object's feature. |
Object |
remove(InternalEObject internalObject,
EStructuralFeature feature,
int index)
Removes the value at the index in the
content of the object's feature. |
protected Object |
setAttribute(PersistentEObject object,
EAttribute attribute,
int index,
Object value)
Sets the value at the
index in the content of the attribute of the object. |
protected Object |
setReference(PersistentEObject object,
EReference reference,
int index,
PersistentEObject value)
Sets the value at the
index in the content of the reference of the object. |
int |
size(InternalEObject internalObject,
EStructuralFeature feature)
Returns the number of values in the
content of the object's feature. |
addAttribute, addReference, contains, eObject, getContainer, getContainingFeature, getFromMap, getFromMap, isSet, removeAttribute, removeReference, unset, updateContainment, updateInstanceOfclearAttribute, clearReference, containsAttribute, containsReference, create, get, hashCode, indexOfAttribute, indexOfReference, isEmpty, isSetAttribute, isSetReference, lastIndexOfAttribute, lastIndexOfReference, move, parseProperty, resource, save, serializeToProperty, set, toArray, toArray, unsetAttribute, unsetReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllInstancespublic DirectWriteMapDbIndicesStore(Resource.Internal resource, MapDbPersistenceBackend backend)
DirectWriteMapDbIndicesStore between the given resource and the
backend.resource - the resource to persist and accessbackend - the persistence back-end used to store the modelpublic void add(InternalEObject internalObject, EStructuralFeature feature, int index, Object value)
AbstractDirectWriteStorecontent of the object's feature.
By default, calls the associated methods depending on the type of the feature.
add in interface InternalEObject.EStoreadd in class AbstractDirectWriteStore<MapDbPersistenceBackend>internalObject - the object in question.feature - a many-valued feature of the object.index - an index within the content.value - the value to add.AbstractDirectWriteStore.addAttribute(PersistentEObject, EAttribute, int, Object),
AbstractDirectWriteStore.addReference(PersistentEObject, EReference, int, PersistentEObject)public Object remove(InternalEObject internalObject, EStructuralFeature feature, int index)
AbstractDirectWriteStorecontent of the object's feature.
By default, calls the associated methods depending on the type of the feature.
remove in interface InternalEObject.EStoreremove in class AbstractDirectWriteStore<MapDbPersistenceBackend>internalObject - the object in question.feature - a many-valued feature of the object.index - the index within the feature's content of the value to remove.AbstractDirectWriteStore.removeAttribute(PersistentEObject, EAttribute, int),
AbstractDirectWriteStore.removeReference(PersistentEObject, EReference, int)public int indexOf(InternalEObject internalObject, EStructuralFeature feature, Object value)
AbstractDirectWriteStorecontent of the object's feature.
By default, calls the associated methods depending on the type of the feature.
indexOf in interface InternalEObject.EStoreindexOf in class DirectWriteMapDbStoreinternalObject - the object in question.feature - a many-valued feature of the object.value - the value in question.AbstractDirectWriteStore.indexOfAttribute(PersistentEObject, EAttribute, Object),
AbstractDirectWriteStore.indexOfReference(PersistentEObject, EReference, PersistentEObject)public int lastIndexOf(InternalEObject internalObject, EStructuralFeature feature, Object value)
AbstractDirectWriteStorecontent of the object's feature.
By default, calls the associated methods depending on the type of the feature.
lastIndexOf in interface InternalEObject.EStorelastIndexOf in class DirectWriteMapDbStoreinternalObject - the object in question.feature - a many-valued feature of the object.value - the value in question.AbstractDirectWriteStore.lastIndexOfAttribute(PersistentEObject, EAttribute, Object),
AbstractDirectWriteStore.lastIndexOfReference(PersistentEObject, EReference, PersistentEObject)public void clear(InternalEObject internalObject, EStructuralFeature feature)
AbstractDirectWriteStorecontent of the object's feature
By default, calls the associated methods depending on the type of the feature.
clear in interface InternalEObject.EStoreclear in class DirectWriteMapDbStoreinternalObject - the object in question.feature - a many-valued feature of the object.AbstractDirectWriteStore.clearAttribute(PersistentEObject, EAttribute),
AbstractDirectWriteStore.clearReference(PersistentEObject, EReference)protected Object getAttribute(PersistentEObject object, EAttribute attribute, int index)
AbstractDirectWriteStoreindex in the content of the attribute of the object.getAttribute in class DirectWriteMapDbStoreobject - the objectattribute - an attribute of the objectindex - an index within the content or PersistentStore.NO_INDEXAbstractDirectWriteStore.get(InternalEObject, EStructuralFeature, int)protected Object getReference(PersistentEObject object, EReference reference, int index)
AbstractDirectWriteStoreindex in the content of the reference of the object.getReference in class DirectWriteMapDbStoreobject - the objectreference - a reference of the objectindex - an index within the content or PersistentStore.NO_INDEXAbstractDirectWriteStore.get(InternalEObject, EStructuralFeature, int)protected Object setAttribute(PersistentEObject object, EAttribute attribute, int index, Object value)
AbstractDirectWriteStoreindex in the content of the attribute of the object.setAttribute in class DirectWriteMapDbStoreobject - the objectattribute - an attribute of the objectindex - an index within the content or PersistentStore.NO_INDEXvalue - the new valueAbstractDirectWriteStore.set(InternalEObject, EStructuralFeature, int, Object)protected Object setReference(PersistentEObject object, EReference reference, int index, PersistentEObject value)
AbstractDirectWriteStoreindex in the content of the reference of the object.setReference in class DirectWriteMapDbStoreobject - the objectreference - a reference of the objectindex - an index within the content or PersistentStore.NO_INDEXvalue - the new valueAbstractDirectWriteStore.set(InternalEObject, EStructuralFeature, int, Object)public int size(InternalEObject internalObject, EStructuralFeature feature)
org.eclipse.emf.ecore.InternalEObject.EStorecontent of the object's feature.size in interface InternalEObject.EStoresize in class DirectWriteMapDbStoreinternalObject - the object in question.feature - a many-valued feature of the object.Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.