Class 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 long serialVersionUID
      Serial version id.
      private static SingleThreadLocalMarker suppressNotifications  
      • Fields inherited from class org.eclipse.emf.ecore.util.EObjectEList

        featureID
      • Fields inherited from class org.eclipse.emf.ecore.util.EcoreEList

        dataClass, owner
      • Fields inherited from class org.eclipse.emf.common.util.BasicEList

        data, size
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      ModelEObjectEList​(java.lang.Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID)
      Creates and initializes a new ModelEObjectEList instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      void addUniqueSuppressNotifications​(E object)  
      protected void afterChange()
      The method will be invoked after property change.
      protected 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.
      org.eclipse.emf.common.notify.NotificationChain basicAdd​(E object, org.eclipse.emf.common.notify.NotificationChain notifications)  
      boolean basicContains​(java.lang.Object object)  
      boolean basicContainsAll​(java.util.Collection<?> collection)  
      E basicGet​(int index)  
      int basicIndexOf​(java.lang.Object object)  
      int basicLastIndexOf​(java.lang.Object object)  
      java.util.List<E> basicList()  
      java.lang.Object[] basicToArray()  
      <T> T[] basicToArray​(T[] array)  
      protected void beforeChange​(java.lang.String featureName)
      The method will be invoked before specified property change.
      void clear()
      Clears the list of all objects.
      boolean contains​(java.lang.Object object)  
      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.
      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.
      protected E doRemove​(int index)
      Removes the object at the index from the list and returns it; it does no inverse updating, or notification.
      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.
      E get​(int index)  
      protected java.lang.String getPropertyEventName​(java.lang.Object value)
      Returns name property change event.
      protected boolean hasInverse()  
      protected boolean hasManyInverse()  
      protected boolean hasNavigableInverse()  
      int indexOf​(java.lang.Object object)  
      boolean isEmpty()  
      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.
      protected E primitiveGet​(int index)  
      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.
      int size()  
      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 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.util.AbstractList

        removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        containsAll
      • Methods inherited from class java.lang.Object

        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, basicIterator, basicListIterator, basicListIterator, basicRemove
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        add, add, addAll, addAll, containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, replaceAll, retainAll, set, sort, spliterator, subList
    • Constructor Detail

      • ModelEObjectEList

        public ModelEObjectEList​(java.lang.Class<?> dataClass,
                                 org.eclipse.emf.ecore.InternalEObject owner,
                                 int featureID)
        Creates and initializes a new ModelEObjectEList instance.
        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:
        assign in class org.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:
        doRemove in class org.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 as required and delegates to EcoreEList.inverseRemove(Object, org.eclipse.emf.common.notify.NotificationChain) as required.
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
        Overrides:
        clear in class org.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:
        hasInverse in class org.eclipse.emf.ecore.util.EObjectEList<E>
      • hasNavigableInverse

        protected boolean hasNavigableInverse()
        Overrides:
        hasNavigableInverse in class org.eclipse.emf.ecore.util.EcoreEList<E>
      • hasManyInverse

        protected boolean hasManyInverse()
        Overrides:
        hasManyInverse in class org.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 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.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, 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.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 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.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 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.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 as required.
        Specified by:
        move in interface org.eclipse.emf.common.util.EList<E>
        Overrides:
        move in class org.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 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.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 as required and delegates to inverseRemove as required.
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class org.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 as required and delegates to inverseRemove as required.
        Specified by:
        removeAll in interface java.util.Collection<E>
        Specified by:
        removeAll in interface java.util.List<E>
        Overrides:
        removeAll in class org.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)
        Specified by:
        basicGet in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicGet in class org.eclipse.emf.common.util.BasicEList<E>
      • basicList

        public java.util.List<E> basicList()
        Specified by:
        basicList in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicList in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • basicToArray

        public java.lang.Object[] basicToArray()
        Specified by:
        basicToArray in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicToArray in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • basicToArray

        public <T> T[] basicToArray​(T[] array)
        Specified by:
        basicToArray in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicToArray in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
        Overrides:
        size in class org.eclipse.emf.common.util.BasicEList<E>
      • basicIndexOf

        public int basicIndexOf​(java.lang.Object object)
        Specified by:
        basicIndexOf in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicIndexOf in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • basicLastIndexOf

        public int basicLastIndexOf​(java.lang.Object object)
        Specified by:
        basicLastIndexOf in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicLastIndexOf in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • basicContains

        public boolean basicContains​(java.lang.Object object)
        Specified by:
        basicContains in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicContains in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • basicContainsAll

        public boolean basicContainsAll​(java.util.Collection<?> collection)
        Specified by:
        basicContainsAll in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicContainsAll in class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
      • indexOf

        public int indexOf​(java.lang.Object object)
        Specified by:
        indexOf in interface java.util.List<E>
        Overrides:
        indexOf in class org.eclipse.emf.ecore.util.EcoreEList<E>
      • contains

        public boolean contains​(java.lang.Object object)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.List<E>
        Overrides:
        contains in class org.eclipse.emf.ecore.util.EcoreEList<E>
      • basicAdd

        public org.eclipse.emf.common.notify.NotificationChain basicAdd​(E object,
                                                                        org.eclipse.emf.common.notify.NotificationChain notifications)
        Specified by:
        basicAdd in interface org.eclipse.emf.ecore.util.InternalEList<E>
        Overrides:
        basicAdd in class org.eclipse.emf.common.notify.impl.NotifyingListImpl<E>
      • get

        public E get​(int index)
        Specified by:
        get in interface java.util.List<E>
        Overrides:
        get in class org.eclipse.emf.common.util.BasicEList<E>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Specified by:
        isEmpty in interface java.util.List<E>
        Overrides:
        isEmpty in class org.eclipse.emf.common.util.BasicEList<E>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object object)
        Specified by:
        lastIndexOf in interface java.util.List<E>
        Overrides:
        lastIndexOf in class org.eclipse.emf.ecore.util.EcoreEList<E>
      • primitiveGet

        protected E primitiveGet​(int index)
        Overrides:
        primitiveGet in class org.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:
        doMove in class org.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.