Package com.nomagic.magicdraw.uml2.util
Class ModelEStoreEList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.eclipse.emf.common.util.AbstractEList<E>
-
- org.eclipse.emf.common.util.DelegatingEList<E>
-
- org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
-
- org.eclipse.emf.ecore.util.DelegatingNotifyingInternalEListImpl<E>
-
- org.eclipse.emf.ecore.util.DelegatingEcoreEList<E>
-
- org.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic<E>
-
- org.eclipse.emf.ecore.util.DelegatingEcoreEList.Dynamic<E>
-
- com.nomagic.magicdraw.emf.impl.BasicEStoreEList<E>
-
- com.nomagic.magicdraw.uml2.util.ModelEStoreEList<E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,org.eclipse.emf.common.notify.NotifyingList<E>
,org.eclipse.emf.common.util.EList<E>
,org.eclipse.emf.ecore.EStructuralFeature.Setting
,org.eclipse.emf.ecore.util.InternalEList<E>
,org.eclipse.emf.ecore.util.InternalEList.Unsettable<E>
- Direct Known Subclasses:
NoNullModelEStoreEList
,SubsetSupersetEObjectEStoreEList
public class ModelEStoreEList<E> extends BasicEStoreEList<E>
A list that delegates to a store.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList
org.eclipse.emf.ecore.util.DelegatingEcoreEList.Dynamic<E extends java.lang.Object>, org.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic<E extends java.lang.Object>, org.eclipse.emf.ecore.util.DelegatingEcoreEList.UnmodifiableEList<E extends java.lang.Object>, org.eclipse.emf.ecore.util.DelegatingEcoreEList.Unsettable<E extends java.lang.Object>
-
Nested classes/interfaces inherited from class org.eclipse.emf.common.util.DelegatingEList
org.eclipse.emf.common.util.DelegatingEList.EIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.DelegatingEList.EListIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.DelegatingEList.NonResolvingEIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.DelegatingEList.NonResolvingEListIterator<E1 extends java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Fields inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Dynamic
eStructuralFeature
-
-
Constructor Summary
Constructors Constructor Description ModelEStoreEList(org.eclipse.emf.ecore.InternalEObject owner, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
Creates and initializes a newModelEStoreEList
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, E object)
Adds the object at the given index in the list.boolean
addAllUnique(int index, java.util.Collection<? extends E> collection)
Adds each object of the collection at each successive index in the list and returns whether any objects were added; it does no ranging checking or uniqueness checking.void
addUnique(int index, E object)
Adds the object at the given index in the list; it does no ranging checking or uniqueness checking.void
addUnique(E object)
Adds the object at the end of the list; it does no uniqueness checking.protected void
afterChange()
org.eclipse.emf.common.notify.NotificationChain
basicRemove(java.lang.Object object, org.eclipse.emf.common.notify.NotificationChain notifications)
protected void
beforeChange(java.lang.String featureName)
The method will be invoked before specified property change.protected void
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, int index)
Implementation must fire property change event.protected void
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, int index, int newIndex)
Implementation must fire property change event.protected java.lang.String
getPropertyEventName(java.lang.Object value)
Returns name of the property change event.protected boolean
hasProxies()
int
indexOf(java.lang.Object object)
private boolean
isEMFProxiesSupported()
protected boolean
isRawMode()
Method should return true if event support is in raw mode.int
lastIndexOf(java.lang.Object object)
E
move(int targetIndex, int sourceIndex)
Moves the object at the source index of the list to the target index of the list and returns the moved object.E
remove(int index)
Removes the object at the index from the list and returns it.boolean
removeAll(java.util.Collection<?> collection)
Removes each object of the collection from the list and returns whether any object was actually contained by the list.E
setUnique(int index, E object)
Sets the object at the index and returns the old object at the index; it does no ranging checking or uniqueness checking.protected void
startLogEvents()
Starts logging of events.protected void
stopLogEvents()
Stops logging of events.protected E
validate(int index, E object)
Validates a new content object and returns the validated object.-
Methods inherited from class com.nomagic.magicdraw.emf.impl.BasicEStoreEList
delegateAdd, delegateAdd, delegateBasicList, delegateClear, delegateContains, delegateContainsAll, delegateEquals, delegateGet, delegateHashCode, delegateIndexOf, delegateIsEmpty, delegateIterator, delegateLastIndexOf, delegateList, delegateListIterator, delegateMove, delegateRemove, delegateSet, delegateSize, delegateToArray, delegateToArray, delegateToString, eStore, getEStructuralFeature, makeLastInCollection
-
Methods inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic
canContainNull, didChange, hasInstanceClass, hasInverse, hasManyInverse, hasNavigableInverse, isContainer, isContainment, isEObject, isSet, isUnique, isUnsettable, kind, unset, useEquals
-
Methods inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList
contains, createNotification, createNotification, dispatchNotification, get, getEObject, getFeature, getFeatureID, getFeatureType, getInverseEReference, getInverseFeatureClass, getInverseFeatureID, getNotifier, inverseAdd, inverseRemove, isInstance, isNotificationRequired, resolve, resolve, resolveProxy, set, toArray, toArray
-
Methods inherited from class org.eclipse.emf.ecore.util.DelegatingNotifyingInternalEListImpl
basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArray
-
Methods inherited from class org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl
addAllUnique, addAllUnique, addAllUnique, basicAdd, basicSet, clear, createNotification, createNotificationChain, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddUnique, doAddUnique, doClear, doMove, doRemove, doRemoveAll, doSetUnique, getFeatureID, hasShadow, shadowAdd, shadowRemove, shadowSet
-
Methods inherited from class org.eclipse.emf.common.util.DelegatingEList
containsAll, doClear, equals, get, hashCode, isEmpty, primitiveGet, remove, retainAll, size, toString
-
Methods inherited from class org.eclipse.emf.common.util.AbstractEList
add, addAll, addAll, didAdd, didClear, didMove, didRemove, didSet, equalObjects, getDuplicates, getNonDuplicates, iterator, listIterator, listIterator, move, set
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModelEStoreEList
public ModelEStoreEList(org.eclipse.emf.ecore.InternalEObject owner, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
Creates and initializes a newModelEStoreEList
instance.- Parameters:
owner
- owner of the collection.eStructuralFeature
- feature that values is hold by this collection.
-
-
Method Detail
-
getPropertyEventName
protected java.lang.String getPropertyEventName(java.lang.Object value)
Returns name of the property change event.- Overrides:
getPropertyEventName
in classBasicEStoreEList<E>
- Parameters:
value
- property that changed value.- Returns:
- property name.
-
beforeChange
protected final void beforeChange(java.lang.String featureName)
The method will be invoked before specified property change.- Overrides:
beforeChange
in classBasicEStoreEList<E>
- Parameters:
featureName
- name of the feature.
-
afterChange
protected final void afterChange()
- Overrides:
afterChange
in classBasicEStoreEList<E>
-
startLogEvents
protected final void startLogEvents()
Starts logging of events.
-
stopLogEvents
protected final void stopLogEvents()
Stops logging of events.
-
firePropertyChange
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, int index)
Implementation must fire property change event.- Overrides:
firePropertyChange
in classBasicEStoreEList<E>
- Parameters:
propertyName
- name of the changed property.oldValue
- old value of the property.newValue
- new value of the property.index
- index of the new value.
-
firePropertyChange
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, int index, int newIndex)
Implementation must fire property change event.- Overrides:
firePropertyChange
in classBasicEStoreEList<E>
- Parameters:
propertyName
- name of the changed property.oldValue
- old value of the property.newValue
- new value of the property.index
- index of the new value.newIndex
- new index of the value
-
isRawMode
protected final boolean isRawMode()
Method should return true if event support is in raw mode.- Returns:
- true if raw mode.
-
add
public void add(int index, E object)
Adds the object at the given index in the list. Ifuniqueness
is required, duplicates will be ignored. This implementation delegates toaddUnique(int, E)
after uniqueness checking.- Specified by:
add
in interfacejava.util.List<E>
- Overrides:
add
in classorg.eclipse.emf.common.util.AbstractEList<E>
- Parameters:
object
- the object to be added.- Throws:
java.lang.IllegalArgumentException
- ifuniqueness
is required, and the object is a duplicate.- See Also:
addUnique(int, Object)
-
validate
protected E validate(int index, E object)
Validates a new content object and returns the validated object. This implementation checks for null, ifnecessary
and returns the argument object. Clients may throw additional types of runtime exceptions in order to handle constraint violations.- Overrides:
validate
in classorg.eclipse.emf.ecore.util.DelegatingEcoreEList<E>
- Parameters:
index
- the position of the new content.object
- the new content.- Returns:
- the validated content.
- Throws:
java.lang.IllegalArgumentException
- if a constraint prevents the object from being added.
-
addUnique
public void addUnique(E object)
Adds the object at the end of the list; it does no uniqueness checking. In addition to the normal effects, this override implementation generates notifications asrequired
and delegates toinverseAdd
asrequired
.- Specified by:
addUnique
in interfaceorg.eclipse.emf.ecore.util.InternalEList<E>
- Overrides:
addUnique
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
object
- the object to be added.- See Also:
DelegatingEcoreEList.isNotificationRequired()
,DelegatingEcoreEList.Generic.hasInverse()
,DelegatingEcoreEList.inverseAdd(E, org.eclipse.emf.common.notify.NotificationChain)
-
addUnique
public void addUnique(int index, E object)
Adds the object at the given index in the list; it does no ranging checking or uniqueness checking. In addition to the normal effects, this override implementation generates notifications asrequired
and delegates toinverseAdd
asrequired
.- Specified by:
addUnique
in interfaceorg.eclipse.emf.ecore.util.InternalEList<E>
- Overrides:
addUnique
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
object
- the object to be added.- See Also:
DelegatingEcoreEList.isNotificationRequired()
,DelegatingEcoreEList.Generic.hasInverse()
,DelegatingEcoreEList.inverseAdd(E, org.eclipse.emf.common.notify.NotificationChain)
-
setUnique
public E setUnique(int index, E object)
Sets the object at the index and returns the old object at the index; it does no ranging checking or uniqueness checking. In addition to the normal effects, this override implementation generates notifications asrequired
and delegates toinverseAdd
andinverseRemove
asrequired
.- Specified by:
setUnique
in interfaceorg.eclipse.emf.ecore.util.InternalEList<E>
- Overrides:
setUnique
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
index
- the position in question.object
- the object to set.- Returns:
- the old object at the index.
- See Also:
DelegatingEcoreEList.isNotificationRequired()
,DelegatingEcoreEList.Generic.hasInverse()
,DelegatingEcoreEList.inverseAdd(E, org.eclipse.emf.common.notify.NotificationChain)
,DelegatingEcoreEList.inverseRemove(E, org.eclipse.emf.common.notify.NotificationChain)
-
move
public E move(int targetIndex, int sourceIndex)
Moves the object at the source index of the list to the target index of the list and returns the moved object. In addition to the normal effects, this override implementation generates notifications asrequired
.- Specified by:
move
in interfaceorg.eclipse.emf.common.util.EList<E>
- Overrides:
move
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
targetIndex
- the new position for the object in the list.sourceIndex
- the old position of the object in the list.- Returns:
- the moved object.
- Throws:
java.lang.IndexOutOfBoundsException
- if either index isn't within the size range.- See Also:
DelegatingEcoreEList.isNotificationRequired()
-
addAllUnique
public boolean addAllUnique(int index, java.util.Collection<? extends E> collection)
Adds each object of the collection at each successive index in the list and returns whether any objects were added; it does no ranging checking or uniqueness checking. In addition to the normal effects, this override implementation generates notifications asrequired
and delegates toinverseAdd
asrequired
.- Specified by:
addAllUnique
in interfaceorg.eclipse.emf.ecore.util.InternalEList<E>
- Overrides:
addAllUnique
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
index
- the index at which to add.collection
- the collection of objects to be added.- Returns:
- whether any objects were added.
- See Also:
DelegatingEcoreEList.isNotificationRequired()
,DelegatingEcoreEList.Generic.hasInverse()
,DelegatingEcoreEList.inverseAdd(E, org.eclipse.emf.common.notify.NotificationChain)
-
remove
public E remove(int index)
Removes the object at the index from the list and returns it. In addition to the normal effects, this override implementation generates notifications asrequired
and delegates toinverseRemove
asrequired
.- Specified by:
remove
in interfacejava.util.List<E>
- Overrides:
remove
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
index
- the position of the object to remove.- Returns:
- the removed object.
- Throws:
java.lang.IndexOutOfBoundsException
- if the index isn't within the size range.- See Also:
DelegatingEcoreEList.isNotificationRequired()
,DelegatingEcoreEList.Generic.hasInverse()
,DelegatingEcoreEList.inverseRemove(E, org.eclipse.emf.common.notify.NotificationChain)
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
Removes each object of the collection from the list and returns whether any object was actually contained by the list. In addition to the normal effects, this override implementation generates notifications asrequired
and delegates toinverseRemove
asrequired
.- Specified by:
removeAll
in interfacejava.util.Collection<E>
- Specified by:
removeAll
in interfacejava.util.List<E>
- Overrides:
removeAll
in classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
- Parameters:
collection
- the collection of objects to be removed.- Returns:
- whether any object was actually contained by the list.
- See Also:
DelegatingEcoreEList.isNotificationRequired()
,DelegatingEcoreEList.Generic.hasInverse()
,DelegatingEcoreEList.inverseRemove(E, org.eclipse.emf.common.notify.NotificationChain)
-
indexOf
public int indexOf(java.lang.Object object)
-
lastIndexOf
public int lastIndexOf(java.lang.Object object)
-
hasProxies
protected boolean hasProxies()
- Overrides:
hasProxies
in classorg.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic<E>
-
isEMFProxiesSupported
private boolean isEMFProxiesSupported()
-
basicRemove
public org.eclipse.emf.common.notify.NotificationChain basicRemove(java.lang.Object object, org.eclipse.emf.common.notify.NotificationChain notifications)
-
-