@Immutable @ParametersAreNonnullByDefault public abstract class AbstractStoreAdapter extends Object implements StoreAdapter
StoreAdapter
.Modifier | Constructor and Description |
---|---|
protected |
AbstractStoreAdapter(Store store,
org.eclipse.emf.ecore.resource.Resource.Internal resource)
Constructs a new
AbstractStoreAdapter on the given store . |
Modifier and Type | Method and Description |
---|---|
void |
add(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index,
Object value) |
int |
addAll(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index,
Collection<?> values)
Adds the
values from the index in the content of the object's feature. |
void |
clear(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
void |
close()
Cleanly closes this manager, clear all data in-memory and releases any system resources associated with it.
|
boolean |
contains(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
Object value) |
void |
copyTo(StoreAdapter target) |
protected static Cache<Id,PersistentEObject> |
createCache()
Creates a new in-memory cache to store
Id s and their associated PersistentEObject . |
Object |
get(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index) |
List<Object> |
getAll(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature)
Returns all values in the
content of the
object's feature. |
protected abstract Cache<Id,PersistentEObject> |
getCache()
Returns the in-memory cache holding recently loaded
PersistentEObject s. |
PersistentEObject |
getContainer(org.eclipse.emf.ecore.InternalEObject internalObject) |
org.eclipse.emf.ecore.EReference |
getContainingFeature(org.eclipse.emf.ecore.InternalEObject internalObject) |
int |
hashCode(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
int |
indexOf(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
Object value) |
boolean |
isEmpty(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
boolean |
isSet(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
int |
lastIndexOf(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
Object value) |
Object |
move(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
int targetIndex,
int sourceIndex) |
Object |
remove(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index) |
void |
removeContainment(PersistentEObject object)
Removes the containment link between
object and its container, and deletes any previous link to object . |
PersistentEObject |
resolve(Id id)
Retrieves the object associated to the given
id . |
org.eclipse.emf.ecore.EClass |
resolveInstanceOf(Id id)
Compute the
EClass associated to the model element with the provided Id . |
org.eclipse.emf.ecore.resource.Resource.Internal |
resource()
Returns the resource to store and access.
|
void |
resource(org.eclipse.emf.ecore.resource.Resource.Internal resource)
Defines the resource to store and access.
|
void |
save()
Saves all changes made on this manager since the last call.
|
Object |
set(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
int index,
Object value) |
void |
setAll(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
Collection<?> values)
Sets the
values in the content of
the object's feature. |
int |
size(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
Store |
store()
Returns the adapted store chain.
|
Object[] |
toArray(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
<T> T[] |
toArray(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature,
T[] array) |
void |
unset(org.eclipse.emf.ecore.InternalEObject internalObject,
org.eclipse.emf.ecore.EStructuralFeature feature) |
void |
updateContainment(PersistentEObject object,
org.eclipse.emf.ecore.EReference containerReference,
PersistentEObject container)
Creates or updates the containment link between
object and container , and deletes any previous
link to object . |
void |
updateInstanceOf(PersistentEObject object)
Creates the instance of the
object in a ClassBean object and persists it in the database. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, removeAll
@Nonnull protected static Cache<Id,PersistentEObject> createCache()
Id
s and their associated PersistentEObject
.getCache()
@Nonnull protected abstract Cache<Id,PersistentEObject> getCache()
PersistentEObject
s.public void close()
Saveable
Cleanly closes this manager, clear all data in-memory and releases any system resources associated with it. All modifications are saved before closing.
If the manager is already closed, then invoking this method has no effect.
public void save()
Saveable
@Nonnull public Store store()
StoreAdapter
store
in interface StoreAdapter
@Nullable public org.eclipse.emf.ecore.resource.Resource.Internal resource()
StoreAdapter
resource
in interface StoreAdapter
public void resource(@Nullable org.eclipse.emf.ecore.resource.Resource.Internal resource)
StoreAdapter
resource
in interface StoreAdapter
resource
- the resource@Nonnull public final PersistentEObject resolve(Id id)
StoreAdapter
id
.resolve
in interface StoreAdapter
id
- the identifier to be resolved@Nullable public final Object get(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nonnegative int index)
get
in interface StoreAdapter
get
in interface org.eclipse.emf.ecore.InternalEObject.EStore
@Nullable public final Object set(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nonnegative int index, @Nullable Object value)
set
in interface StoreAdapter
set
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final boolean isSet(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
isSet
in interface StoreAdapter
isSet
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final void unset(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
unset
in interface StoreAdapter
unset
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final boolean isEmpty(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
isEmpty
in interface StoreAdapter
isEmpty
in interface org.eclipse.emf.ecore.InternalEObject.EStore
@Nonnegative public final int size(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
size
in interface StoreAdapter
size
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final boolean contains(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nullable Object value)
contains
in interface StoreAdapter
contains
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final int indexOf(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nullable Object value)
indexOf
in interface StoreAdapter
indexOf
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final int lastIndexOf(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nullable Object value)
lastIndexOf
in interface StoreAdapter
lastIndexOf
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final void add(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, int index, Object value)
add
in interface StoreAdapter
add
in interface org.eclipse.emf.ecore.InternalEObject.EStore
@Nullable public final Object remove(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nonnegative int index)
remove
in interface StoreAdapter
remove
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final Object move(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nonnegative int targetIndex, @Nonnegative int sourceIndex)
move
in interface StoreAdapter
move
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final void clear(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
clear
in interface StoreAdapter
clear
in interface org.eclipse.emf.ecore.InternalEObject.EStore
@Nonnull public final Object[] toArray(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
toArray
in interface StoreAdapter
toArray
in interface org.eclipse.emf.ecore.InternalEObject.EStore
@Nonnull public final <T> T[] toArray(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, @Nullable T[] array)
toArray
in interface StoreAdapter
toArray
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final int hashCode(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
hashCode
in interface StoreAdapter
hashCode
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final PersistentEObject getContainer(org.eclipse.emf.ecore.InternalEObject internalObject)
getContainer
in interface StoreAdapter
getContainer
in interface org.eclipse.emf.ecore.InternalEObject.EStore
public final org.eclipse.emf.ecore.EReference getContainingFeature(org.eclipse.emf.ecore.InternalEObject internalObject)
getContainingFeature
in interface StoreAdapter
getContainingFeature
in interface org.eclipse.emf.ecore.InternalEObject.EStore
@Nonnull public List<Object> getAll(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature)
StoreAdapter
content
of the
object's feature.getAll
in interface StoreAdapter
internalObject
- the object in questionfeature
- a feature of the objectpublic void setAll(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, Collection<?> values)
StoreAdapter
values
in the content
of
the object's feature.
If the object's feature already have values, then they will be replaced by values
.
setAll
in interface StoreAdapter
internalObject
- the object in questionfeature
- a feature of the objectvalues
- the new valuespublic int addAll(org.eclipse.emf.ecore.InternalEObject internalObject, org.eclipse.emf.ecore.EStructuralFeature feature, int index, Collection<?> values)
StoreAdapter
values
from the index
in the content
of the object's feature.addAll
in interface StoreAdapter
internalObject
- the object in questionfeature
- a many-valued
feature of the objectindex
- the first index from which to start the addition within the content. If negative, then the
addition will begin from the end of the existing contentvalues
- the value to addpublic void updateContainment(PersistentEObject object, org.eclipse.emf.ecore.EReference containerReference, PersistentEObject container)
StoreAdapter
object
and container
, and deletes any previous
link to object
. The object
is added to the containment list of the container
.
The method checks if an existing container is stored and update it if needed.
updateContainment
in interface StoreAdapter
object
- the object to add in the containment list of the container
containerReference
- the containment reference, from the container
to the object
container
- the containerpublic void removeContainment(PersistentEObject object)
StoreAdapter
object
and its container, and deletes any previous link to object
.removeContainment
in interface StoreAdapter
object
- the object to remove from the containment list of its actual container@Nonnull public org.eclipse.emf.ecore.EClass resolveInstanceOf(Id id)
StoreAdapter
EClass
associated to the model element with the provided Id
.resolveInstanceOf
in interface StoreAdapter
id
- the Id
of the model element to compute the EClass
fromEClass
representing the meta-class of the elementpublic void updateInstanceOf(PersistentEObject object)
StoreAdapter
object
in a ClassBean
object and persists it in the database.
Note: The type is not updated if object
was previously mapped to another type.
updateInstanceOf
in interface StoreAdapter
object
- the object to store the instance-of information frompublic void copyTo(StoreAdapter target)
copyTo
in interface Copiable<StoreAdapter>
Copyright © 2013–2019 Atlanmod. All rights reserved.