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.dassault_systemes.modeler.foundation.emf.impl.AbstractEStoreEList<E>
com.nomagic.magicdraw.emf.impl.BasicEStoreEList<E>
com.nomagic.magicdraw.uml2.util.ModelEStoreEList<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, 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:
  • Field Summary

    Fields inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Dynamic

    eStructuralFeature

    Fields inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic

    HAS_INSTANCE_CLASS, HAS_MANY_INVERSE, HAS_NAVIGABLE_INVERSE, HAS_PROXIES, IS_CONTAINER, IS_CONTAINMENT, IS_ENUM, IS_EOBJECT, IS_PRIMITIVE, IS_SET, IS_UNIQUE, IS_UNSETTABLE, kind

    Fields inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList

    owner

    Fields inherited from class java.util.AbstractList

    modCount
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModelEStoreEList(org.eclipse.emf.ecore.InternalEObject owner, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
    Creates and initializes a new ModelEStoreEList instance.
  • Method Summary

    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, 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 final void
    The method will be invoked after specified property.
    org.eclipse.emf.common.notify.NotificationChain
    basicRemove(Object object, org.eclipse.emf.common.notify.NotificationChain notifications)
     
    protected final void
    The method will be invoked before specified property change.
    protected void
    firePropertyChange(String propertyName, Object oldValue, Object newValue, int index)
    Implementation must fire property change event.
    protected void
    firePropertyChange(String propertyName, Object oldValue, Object newValue, int index, int newIndex)
    Implementation must fire property change event.
    protected String
    Returns name of the property change event.
    protected boolean
     
    int
    indexOf(Object object)
     
    int
     
    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.
    remove(int index)
    Removes the object at the index from the list and returns it.
    boolean
    removeAll(Collection<?> collection)
    Removes each object of the collection from the list and returns whether any object was actually contained by the list.
    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 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

    createOperationTimeoutException, getLockProvider

    Methods inherited from class com.dassault_systemes.modeler.foundation.emf.impl.AbstractEStoreEList

    delegateAdd, delegateAdd, delegateBasicList, delegateClear, delegateContains, delegateContainsAll, delegateEquals, delegateGet, delegateHashCode, delegateIndexOf, delegateIsEmpty, delegateIterator, delegateLastIndexOf, delegateList, delegateListIterator, delegateMove, delegateRemove, delegateSet, delegateSize, delegateToArray, delegateToArray, delegateToString, eStore, execute, getEStructuralFeature, makeLastInCollection, snapshot

    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, containsAll, 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

    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.util.AbstractList

    removeRange, subList

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface org.eclipse.emf.common.util.EList

    move

    Methods inherited from interface org.eclipse.emf.ecore.util.InternalEList

    addAllUnique, basicAdd, basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArray

    Methods inherited from interface java.lang.Iterable

    forEach
  • Constructor Details

    • ModelEStoreEList

      public ModelEStoreEList(org.eclipse.emf.ecore.InternalEObject owner, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature)
      Creates and initializes a new ModelEStoreEList instance.
      Parameters:
      owner - owner of the collection.
      eStructuralFeature - feature that values is hold by this collection.
  • Method Details

    • getPropertyEventName

      protected String getPropertyEventName(Object value)
      Returns name of the property change event.
      Overrides:
      getPropertyEventName in class com.dassault_systemes.modeler.foundation.emf.impl.AbstractEStoreEList<E>
      Parameters:
      value - property that changed value.
      Returns:
      property name.
    • beforeChange

      protected final void beforeChange()
      The method will be invoked before specified property change.
      Overrides:
      beforeChange in class BasicEStoreEList<E>
    • afterChange

      protected final void afterChange()
      Description copied from class: com.dassault_systemes.modeler.foundation.emf.impl.AbstractEStoreEList
      The method will be invoked after specified property.
      Overrides:
      afterChange in class BasicEStoreEList<E>
    • firePropertyChange

      protected void firePropertyChange(String propertyName, Object oldValue, Object newValue, int index)
      Implementation must fire property change event.
      Overrides:
      firePropertyChange in class BasicEStoreEList<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(String propertyName, Object oldValue, 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
    • add

      public void add(int index, E object)
      Adds the object at the given index in the list. If uniqueness is required, duplicates will be ignored. This implementation delegates to addUnique(int, E) after uniqueness checking.
      Specified by:
      add in interface List<E>
      Overrides:
      add in class org.eclipse.emf.common.util.AbstractEList<E>
      Parameters:
      object - the object to be added.
      Throws:
      IllegalArgumentException - if uniqueness is required, and the object is a duplicate.
      See Also:
    • validate

      protected E validate(int index, E object)
      Validates a new content object and returns the validated object. This implementation checks for null, if necessary and returns the argument object. Clients may throw additional types of runtime exceptions in order to handle constraint violations.
      Overrides:
      validate in class org.eclipse.emf.ecore.util.DelegatingEcoreEList<E>
      Parameters:
      index - the position of the new content.
      object - the new content.
      Returns:
      the validated content.
      Throws:
      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 as required and delegates to inverseAdd as required.
      Specified by:
      addUnique in interface org.eclipse.emf.ecore.util.InternalEList<E>
      Overrides:
      addUnique in class org.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 as required and delegates to inverseAdd as required.
      Specified by:
      addUnique in interface org.eclipse.emf.ecore.util.InternalEList<E>
      Overrides:
      addUnique in class org.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 as required and delegates to inverseAdd and inverseRemove as required.
      Specified by:
      setUnique in interface org.eclipse.emf.ecore.util.InternalEList<E>
      Overrides:
      setUnique in class org.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 as required.
      Specified by:
      move in interface org.eclipse.emf.common.util.EList<E>
      Overrides:
      move in class org.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:
      IndexOutOfBoundsException - if either index isn't within the size range.
      See Also:
      • DelegatingEcoreEList.isNotificationRequired()
    • addAllUnique

      public boolean addAllUnique(int index, 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 as required and delegates to inverseAdd as required.
      Specified by:
      addAllUnique in interface org.eclipse.emf.ecore.util.InternalEList<E>
      Overrides:
      addAllUnique in class org.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 as required and delegates to inverseRemove as required.
      Specified by:
      remove in interface List<E>
      Overrides:
      remove in class org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
      Parameters:
      index - the position of the object to remove.
      Returns:
      the removed object.
      Throws:
      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(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 as required and delegates to inverseRemove as required.
      Specified by:
      removeAll in interface Collection<E>
      Specified by:
      removeAll in interface List<E>
      Overrides:
      removeAll in class org.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(Object object)
      Specified by:
      indexOf in interface List<E>
      Overrides:
      indexOf in class org.eclipse.emf.ecore.util.DelegatingEcoreEList<E>
    • lastIndexOf

      public int lastIndexOf(Object object)
      Specified by:
      lastIndexOf in interface List<E>
      Overrides:
      lastIndexOf in class org.eclipse.emf.ecore.util.DelegatingEcoreEList<E>
    • hasProxies

      protected boolean hasProxies()
      Overrides:
      hasProxies in class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic<E>
    • basicRemove

      public org.eclipse.emf.common.notify.NotificationChain basicRemove(Object object, org.eclipse.emf.common.notify.NotificationChain notifications)
      Specified by:
      basicRemove in interface org.eclipse.emf.ecore.util.InternalEList<E>
      Overrides:
      basicRemove in class org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>