Class SubsetSupersetEObjectEStoreEList<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:
    SubsetSupersetEObjectEStoreContainmentEList, SubsetSupersetEObjectEStoreResolvingEList, SubsetSupersetEObjectEStoreWithInverseEList

    public class SubsetSupersetEObjectEStoreEList<E>
    extends ModelEStoreEList<E>
    A list that enforces subset/superset constraints. Specifically, when an element is added to a subset, it is also added to the associated superset(s), if not already present; when an element is removed from a superset, it is also removed from the associated subset(s), if present.
    Since:
    1.2
    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>
      • Nested classes/interfaces inherited from class org.eclipse.emf.common.util.AbstractEList

        org.eclipse.emf.common.util.AbstractEList.BasicIndexOutOfBoundsException
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Class<?> dataClass  
      protected int[] subsetFeatureIDs
      An array of subset feature identifiers.
      protected int[] supersetFeatureIDs
      An array of superset feature identifiers.
      • 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
      SubsetSupersetEObjectEStoreEList​(java.lang.Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, int[] supersetFeatureIDs, int[] subsetFeatureIDs)
      Creates and initializes a new SubsetSupersetEObjectEStoreEList 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 add​(E object)  
      boolean addAll​(int index, java.util.Collection<? extends E> collection)  
      boolean addAll​(java.util.Collection<? extends E> collection)  
      org.eclipse.emf.common.notify.NotificationChain basicAdd​(E object, org.eclipse.emf.common.notify.NotificationChain notifications)  
      org.eclipse.emf.common.notify.NotificationChain basicSet​(int index, E object, org.eclipse.emf.common.notify.NotificationChain notifications)  
      protected void didRemove​(int index, E oldObject)  
      protected boolean enforceSubsetConstraints()
      Indicates whether subset constraints should be enforced.
      protected boolean enforceSupersetConstraints()
      Indicates whether superset constraints should be enforced.
      protected void replaceOrAddToSuperset​(java.lang.Object oldObject, java.lang.Object object)
      Replaces the specified value or adds ir to the superset if new value is not already added.
      protected org.eclipse.emf.ecore.EObject resolve​(int index, org.eclipse.emf.ecore.EObject eObject)  
      E set​(int index, E object)  
      protected void subsetRemove​(java.lang.Object object)
      Removes the specified element from the subset(s).
      protected void supersetAdd​(java.lang.Object object)
      Adds the specified element to the superset(s).
      • 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, 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

        didAdd, didClear, didMove, didSet, equalObjects, getDuplicates, getNonDuplicates, iterator, listIterator, listIterator, move
      • 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, basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        clear, containsAll, equals, get, hashCode, isEmpty, iterator, listIterator, listIterator, remove, replaceAll, retainAll, size, sort, spliterator, subList
    • Field Detail

      • supersetFeatureIDs

        protected final int[] supersetFeatureIDs
        An array of superset feature identifiers.
      • subsetFeatureIDs

        protected final int[] subsetFeatureIDs
        An array of subset feature identifiers.
      • dataClass

        protected java.lang.Class<?> dataClass
    • Constructor Detail

      • SubsetSupersetEObjectEStoreEList

        public SubsetSupersetEObjectEStoreEList​(java.lang.Class<?> dataClass,
                                                org.eclipse.emf.ecore.InternalEObject owner,
                                                int featureID,
                                                @CheckForNull
                                                int[] supersetFeatureIDs,
                                                @CheckForNull
                                                int[] subsetFeatureIDs)
        Creates and initializes a new SubsetSupersetEObjectEStoreEList instance.
        Parameters:
        dataClass - class of data type.
        owner - owner of the collection.
        featureID - feature id of that values is hold by this collection.
        supersetFeatureIDs - array of superset features.
        subsetFeatureIDs - array of subset features.
    • Method Detail

      • enforceSubsetConstraints

        protected boolean enforceSubsetConstraints()
        Indicates whether subset constraints should be enforced.
        Returns:
        true if subset constraints should be enforced; false otherwise.
      • supersetAdd

        protected void supersetAdd​(java.lang.Object object)
        Adds the specified element to the superset(s).
        Parameters:
        object - The element to be added.
      • replaceOrAddToSuperset

        protected void replaceOrAddToSuperset​(java.lang.Object oldObject,
                                              java.lang.Object object)
        Replaces the specified value or adds ir to the superset if new value is not already added.
        Parameters:
        oldObject - old value.
        object - new value.
      • enforceSupersetConstraints

        protected boolean enforceSupersetConstraints()
        Indicates whether superset constraints should be enforced.
        Returns:
        true if superset constraints should be enforced; false otherwise.
      • subsetRemove

        protected void subsetRemove​(java.lang.Object object)
        Removes the specified element from the subset(s).
        Parameters:
        object - The element to be removed.
      • 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.DelegatingNotifyingListImpl<E>
      • basicSet

        public org.eclipse.emf.common.notify.NotificationChain basicSet​(int index,
                                                                        E object,
                                                                        org.eclipse.emf.common.notify.NotificationChain notifications)
        Overrides:
        basicSet in class org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
      • add

        public boolean add​(E object)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class org.eclipse.emf.common.util.AbstractEList<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> collection)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class org.eclipse.emf.common.util.AbstractEList<E>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends E> collection)
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class org.eclipse.emf.common.util.AbstractEList<E>
      • set

        public E set​(int index,
                     E object)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class org.eclipse.emf.common.util.AbstractEList<E>
      • didRemove

        protected void didRemove​(int index,
                                 E oldObject)
        Overrides:
        didRemove in class org.eclipse.emf.common.util.AbstractEList<E>
      • resolve

        protected org.eclipse.emf.ecore.EObject resolve​(int index,
                                                        org.eclipse.emf.ecore.EObject eObject)