Package com.nomagic.magicdraw.uml2.util
Class SubsetSupersetEObjectEStoreEList<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>
com.nomagic.magicdraw.uml2.util.SubsetSupersetEObjectEStoreEList<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:
SubsetSupersetEObjectEStoreContainmentEList,SubsetSupersetEObjectEStoreResolvingEList,SubsetSupersetEObjectEStoreWithInverseEList
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?>protected final int[]An array of subset feature identifiers.protected final int[]An array of superset feature identifiers.Fields inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Dynamic
eStructuralFeatureFields 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, kindFields inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList
ownerFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionSubsetSupersetEObjectEStoreEList(Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, int[] supersetFeatureIDs, int[] subsetFeatureIDs) Creates and initializes a newSubsetSupersetEObjectEStoreEListinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the object at the given index in the list.booleanbooleanaddAll(int index, Collection<? extends E> collection) booleanaddAll(Collection<? extends E> collection) org.eclipse.emf.common.notify.NotificationChainorg.eclipse.emf.common.notify.NotificationChainprotected voidprotected booleanIndicates whether subset constraints should be enforced.protected booleanIndicates whether superset constraints should be enforced.protected voidreplaceOrAddToSuperset(Object oldObject, Object object) Replaces the specified value or adds ir to the superset if new value is not already added.protected org.eclipse.emf.ecore.EObjectresolve(int index, org.eclipse.emf.ecore.EObject eObject) protected voidsubsetRemove(Object object) Removes the specified element from the subset(s).protected voidsupersetAdd(Object object) Adds the specified element to the superset(s).Methods inherited from class com.nomagic.magicdraw.uml2.util.ModelEStoreEList
addAllUnique, addUnique, addUnique, afterChange, basicRemove, beforeChange, firePropertyChange, firePropertyChange, getPropertyEventName, hasProxies, indexOf, lastIndexOf, move, remove, removeAll, setUnique, validateMethods inherited from class com.nomagic.magicdraw.emf.impl.BasicEStoreEList
createOperationTimeoutException, getLockProviderMethods 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, snapshotMethods inherited from class org.eclipse.emf.ecore.util.DelegatingEcoreEList.Generic
canContainNull, didChange, hasInstanceClass, hasInverse, hasManyInverse, hasNavigableInverse, isContainer, isContainment, isEObject, isSet, isUnique, isUnsettable, kind, unset, useEqualsMethods 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, toArrayMethods inherited from class org.eclipse.emf.ecore.util.DelegatingNotifyingInternalEListImpl
basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArrayMethods 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, shadowSetMethods inherited from class org.eclipse.emf.common.util.DelegatingEList
doClear, equals, get, hashCode, isEmpty, primitiveGet, remove, retainAll, size, toStringMethods inherited from class org.eclipse.emf.common.util.AbstractEList
didAdd, didClear, didMove, didSet, equalObjects, getDuplicates, getNonDuplicates, iterator, listIterator, listIterator, moveMethods inherited from class java.util.AbstractList
removeRange, subListMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.emf.common.util.EList
moveMethods inherited from interface org.eclipse.emf.ecore.util.InternalEList
addAllUnique, basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArrayMethods inherited from interface java.util.List
clear, equals, get, hashCode, isEmpty, iterator, listIterator, listIterator, remove, replaceAll, retainAll, size, sort, spliterator, subList
-
Field Details
-
supersetFeatureIDs
protected final int[] supersetFeatureIDsAn array of superset feature identifiers. -
subsetFeatureIDs
protected final int[] subsetFeatureIDsAn array of subset feature identifiers. -
dataClass
-
-
Constructor Details
-
SubsetSupersetEObjectEStoreEList
public SubsetSupersetEObjectEStoreEList(Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, @CheckForNull int[] supersetFeatureIDs, @CheckForNull int[] subsetFeatureIDs) Creates and initializes a newSubsetSupersetEObjectEStoreEListinstance.- 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 Details
-
enforceSubsetConstraints
protected boolean enforceSubsetConstraints()Indicates whether subset constraints should be enforced.- Returns:
trueif subset constraints should be enforced;falseotherwise.
-
supersetAdd
Adds the specified element to the superset(s).- Parameters:
object- The element to be added.
-
replaceOrAddToSuperset
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:
trueif superset constraints should be enforced;falseotherwise.
-
subsetRemove
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) -
basicSet
public org.eclipse.emf.common.notify.NotificationChain basicSet(int index, E object, org.eclipse.emf.common.notify.NotificationChain notifications) - Overrides:
basicSetin classorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl<E>
-
add
Description copied from class:ModelEStoreEListAdds the object at the given index in the list. Ifuniquenessis required, duplicates will be ignored. This implementation delegates toaddUnique(int, E)after uniqueness checking. -
add
-
addAll
-
addAll
-
set
-
didRemove
- Overrides:
didRemovein classorg.eclipse.emf.common.util.AbstractEList<E>
-
resolve
protected org.eclipse.emf.ecore.EObject resolve(int index, org.eclipse.emf.ecore.EObject eObject)
-