Package com.nomagic.magicdraw.uml2.util
Class ModelEObjectEList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.eclipse.emf.common.util.AbstractEList<E>
-
- org.eclipse.emf.common.util.BasicEList<E>
-
- org.eclipse.emf.common.notify.impl.NotifyingListImpl<E>
-
- org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
-
- org.eclipse.emf.ecore.util.EcoreEList<E>
-
- org.eclipse.emf.ecore.util.EObjectEList<E>
-
- com.nomagic.magicdraw.uml2.util.ModelEObjectEList<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess,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:
ModelEObjectResolvingEList,SubsetSupersetEObjectEList
public class ModelEObjectEList<E> extends org.eclipse.emf.ecore.util.EObjectEList<E>Base class for all transient collections of the model.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.EObjectEList
org.eclipse.emf.ecore.util.EObjectEList.Unsettable<E extends java.lang.Object>
-
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.EcoreEList
org.eclipse.emf.ecore.util.EcoreEList.Dynamic<E extends java.lang.Object>, org.eclipse.emf.ecore.util.EcoreEList.Generic<E extends java.lang.Object>, org.eclipse.emf.ecore.util.EcoreEList.UnmodifiableEList<E extends java.lang.Object>
-
Nested classes/interfaces inherited from class org.eclipse.emf.common.util.BasicEList
org.eclipse.emf.common.util.BasicEList.BasicIndexOutOfBoundsException, org.eclipse.emf.common.util.BasicEList.EIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.EListIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.FastCompare<E extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.NonResolvingEIterator<E1 extends java.lang.Object>, org.eclipse.emf.common.util.BasicEList.NonResolvingEListIterator<E1 extends java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDSerial version id.private static SingleThreadLocalMarkersuppressNotifications
-
Constructor Summary
Constructors Constructor Description ModelEObjectEList(java.lang.Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID)Creates and initializes a newModelEObjectEListinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAllUnique(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.voidaddUnique(int index, E object)Adds the object at the given index in the list; it does no ranging checking or uniqueness checking.voidaddUnique(E object)Adds the object at the end of the list; it does no uniqueness checking.voidaddUniqueSuppressNotifications(E object)protected voidafterChange()The method will be invoked after property change.protected Eassign(int index, E object)Assigns the object into the data storage at the given index and returns the object that's been stored.org.eclipse.emf.common.notify.NotificationChainbasicAdd(E object, org.eclipse.emf.common.notify.NotificationChain notifications)booleanbasicContains(java.lang.Object object)booleanbasicContainsAll(java.util.Collection<?> collection)EbasicGet(int index)intbasicIndexOf(java.lang.Object object)intbasicLastIndexOf(java.lang.Object object)java.util.List<E>basicList()java.lang.Object[]basicToArray()<T> T[]basicToArray(T[] array)protected voidbeforeChange(java.lang.String featureName)The method will be invoked before specified property change.voidclear()Clears the list of all objects.booleancontains(java.lang.Object object)protected EdoMove(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; it does no notification.private EdoMoveInternal(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; it does no notification.protected EdoRemove(int index)Removes the object at the index from the list and returns it; it does no inverse updating, or notification.protected voidfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, int index)Implementation must fire property change event.protected voidfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue, int index, int newIndex)Implementation must fire property change event.Eget(int index)protected java.lang.StringgetPropertyEventName(java.lang.Object value)Returns name property change event.protected booleanhasInverse()protected booleanhasManyInverse()protected booleanhasNavigableInverse()intindexOf(java.lang.Object object)booleanisEmpty()protected booleanisRawMode()Method should return true if event support is in raw mode.intlastIndexOf(java.lang.Object object)Emove(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.protected EprimitiveGet(int index)Eremove(int index)Removes the object at the index from the list and returns it.booleanremoveAll(java.util.Collection<?> collection)Removes each object of the collection from the list and returns whether any object was actually contained by the list.EsetUnique(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.intsize()protected voidstartLogEvents()Starts logging of events.protected voidstopLogEvents()Stops logging of events.protected Evalidate(int index, E object)Validates a new content object and returns the validated object.-
Methods inherited from class org.eclipse.emf.ecore.util.EObjectEList
canContainNull, getFeatureID, isEObject, isUnique, resolve, useEquals
-
Methods inherited from class org.eclipse.emf.ecore.util.EcoreEList
createNotification, createNotification, dispatchNotification, get, getEObject, getEStructuralFeature, getFeature, getFeatureType, getInverseEReference, getInverseFeatureClass, getInverseFeatureID, getNotifier, hasInstanceClass, hasProxies, inverseAdd, inverseRemove, isContainment, isInstance, isNotificationRequired, isSet, newData, resolve, resolve, resolveProxy, set, toArray, toArray, unset
-
Methods inherited from class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl
basicIterator, basicListIterator, basicListIterator
-
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifyingListImpl
addAllUnique, addAllUnique, addAllUnique, basicRemove, basicSet, createNotification, createNotificationChain, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddUnique, doAddUnique, doClear, doRemoveAll, doSetUnique, getFeatureID, hasShadow, shadowAdd, shadowRemove, shadowSet
-
Methods inherited from class org.eclipse.emf.common.util.BasicEList
clone, data, grow, setData, shrink
-
Methods inherited from class org.eclipse.emf.common.util.AbstractEList
add, add, addAll, addAll, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, getDuplicates, getNonDuplicates, hashCode, iterator, listIterator, listIterator, move, remove, retainAll, set, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serial version id.- See Also:
- Constant Field Values
-
suppressNotifications
private static final SingleThreadLocalMarker suppressNotifications
-
-
Constructor Detail
-
ModelEObjectEList
public ModelEObjectEList(java.lang.Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID)Creates and initializes a newModelEObjectEListinstance.- Parameters:
dataClass- data class.owner- owner of the setting.featureID- feature id.
-
-
Method Detail
-
getPropertyEventName
protected java.lang.String getPropertyEventName(java.lang.Object value)
Returns name property change event.- Parameters:
value- value that was changed.- Returns:
- property name.
-
beforeChange
protected final void beforeChange(java.lang.String featureName)
The method will be invoked before specified property change.- Parameters:
featureName- name of the feature.
-
afterChange
protected final void afterChange()
The method will be invoked after property change.
-
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.- 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.- 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.
-
assign
protected final E assign(int index, E object)
Assigns the object into the data storage at the given index and returns the object that's been stored. Clients can monitor access to the storage via this method.- Overrides:
assignin classorg.eclipse.emf.common.util.BasicEList<E>- Parameters:
index- the position of the new content.object- the new content.- Returns:
- the object that's been stored.
-
addUniqueSuppressNotifications
public void addUniqueSuppressNotifications(E object)
-
doRemove
protected E doRemove(int index)
Removes the object at the index from the list and returns it; it does no inverse updating, or notification.- Overrides:
doRemovein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<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.
-
clear
public void clear()
Clears the list of all objects. In addition to the normal effects, this override implementation generates notifications asrequiredand delegates toEcoreEList.inverseRemove(Object, org.eclipse.emf.common.notify.NotificationChain)asrequired.- Specified by:
clearin interfacejava.util.Collection<E>- Specified by:
clearin interfacejava.util.List<E>- Overrides:
clearin classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<E>- See Also:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.inverseRemove(Object, org.eclipse.emf.common.notify.NotificationChain)
-
hasInverse
protected boolean hasInverse()
- Overrides:
hasInversein classorg.eclipse.emf.ecore.util.EObjectEList<E>
-
hasNavigableInverse
protected boolean hasNavigableInverse()
- Overrides:
hasNavigableInversein classorg.eclipse.emf.ecore.util.EcoreEList<E>
-
hasManyInverse
protected boolean hasManyInverse()
- Overrides:
hasManyInversein classorg.eclipse.emf.ecore.util.EcoreEList<E>
-
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 asrequiredand delegates toinverseAddasrequired.- Specified by:
addUniquein interfaceorg.eclipse.emf.ecore.util.InternalEList<E>- Overrides:
addUniquein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<E>- Parameters:
object- the object to be added.- See Also:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.inverseAdd(E, org.eclipse.emf.common.notify.NotificationChain)
-
validate
protected E validate(int index, E object)
Validates a new content object and returns the validated object. This implementation checks for null, ifnecessaryand returns the argument object. Clients may throw additional types of runtime exceptions in order to handle constraint violations.- Overrides:
validatein classorg.eclipse.emf.ecore.util.EcoreEList<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(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 asrequiredand delegates toinverseAddasrequired.- Specified by:
addUniquein interfaceorg.eclipse.emf.ecore.util.InternalEList<E>- Overrides:
addUniquein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<E>- Parameters:
object- the object to be added.- See Also:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.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 asrequiredand delegates toinverseAddandinverseRemoveasrequired.- Specified by:
setUniquein interfaceorg.eclipse.emf.ecore.util.InternalEList<E>- Overrides:
setUniquein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<E>- Parameters:
index- the position in question.object- the object to set.- Returns:
- the old object at the index.
- See Also:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.inverseAdd(E, org.eclipse.emf.common.notify.NotificationChain),EcoreEList.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:
movein interfaceorg.eclipse.emf.common.util.EList<E>- Overrides:
movein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<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:
EcoreEList.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 asrequiredand delegates toinverseAddasrequired.- Specified by:
addAllUniquein interfaceorg.eclipse.emf.ecore.util.InternalEList<E>- Overrides:
addAllUniquein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<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:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.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 asrequiredand delegates toinverseRemoveasrequired.- Specified by:
removein interfacejava.util.List<E>- Overrides:
removein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<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:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.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 asrequiredand delegates toinverseRemoveasrequired.- Specified by:
removeAllin interfacejava.util.Collection<E>- Specified by:
removeAllin interfacejava.util.List<E>- Overrides:
removeAllin classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<E>- Parameters:
collection- the collection of objects to be removed.- Returns:
- whether any object was actually contained by the list.
- See Also:
EcoreEList.isNotificationRequired(),hasInverse(),EcoreEList.inverseRemove(E, org.eclipse.emf.common.notify.NotificationChain)
-
basicGet
public E basicGet(int index)
-
basicList
public java.util.List<E> basicList()
-
basicToArray
public java.lang.Object[] basicToArray()
-
basicToArray
public <T> T[] basicToArray(T[] array)
-
size
public int size()
-
basicIndexOf
public int basicIndexOf(java.lang.Object object)
-
basicLastIndexOf
public int basicLastIndexOf(java.lang.Object object)
-
basicContains
public boolean basicContains(java.lang.Object object)
-
basicContainsAll
public boolean basicContainsAll(java.util.Collection<?> collection)
-
indexOf
public int indexOf(java.lang.Object object)
-
contains
public boolean contains(java.lang.Object object)
-
basicAdd
public org.eclipse.emf.common.notify.NotificationChain basicAdd(E object, org.eclipse.emf.common.notify.NotificationChain notifications)
-
get
public E get(int index)
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(java.lang.Object object)
-
primitiveGet
protected E primitiveGet(int index)
- Overrides:
primitiveGetin classorg.eclipse.emf.common.util.BasicEList<E>
-
doMove
protected E doMove(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; it does no notification.- Overrides:
doMovein classorg.eclipse.emf.common.notify.impl.NotifyingListImpl<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.
-
doMoveInternal
private E doMoveInternal(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; it does no notification.- 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.
-
-