Package com.nomagic.magicdraw.uml2.util
Class SubsetSupersetEObjectEList<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.dassault_systemes.modeler.foundation.util.AbstractModelEObjectEList<E>
com.nomagic.magicdraw.uml2.util.ModelEObjectEList<E>
com.nomagic.magicdraw.uml2.util.SubsetSupersetEObjectEList<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,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:
SubsetSupersetEObjectContainmentEList,SubsetSupersetEObjectResolvingEList,SubsetSupersetEObjectWithInverseEList
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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.EObjectEList
featureIDFields inherited from class org.eclipse.emf.ecore.util.EcoreEList
dataClass, ownerFields inherited from class org.eclipse.emf.common.util.BasicEList
data, sizeFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionSubsetSupersetEObjectEList(Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, int[] supersetFeatureIDs, int[] subsetFeatureIDs) Creates and initializes a newModelEObjectEListinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> collection) booleanaddAll(Collection<? extends E> collection) org.eclipse.emf.common.notify.NotificationChainorg.eclipse.emf.common.notify.NotificationChainprotected voidbasicSupersetAdd(Object object, org.eclipse.emf.common.notify.NotificationChain notifications) Adds the specified element to the superset(s).protected 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.ModelEObjectEList
checkCompatibility, createOperationTimeoutException, getEventSupporter, getLockProviderMethods inherited from class com.dassault_systemes.modeler.foundation.util.AbstractModelEObjectEList
addAllUnique, addUnique, addUnique, afterChange, assign, basicContains, basicContainsAll, basicGet, basicIndexOf, basicLastIndexOf, basicList, basicToArray, basicToArray, beforeChange, clear, contains, doMove, doRemove, execute, firePropertyChange, get, getPropertyEventName, hasInverse, hasManyInverse, hasNavigableInverse, indexOf, isEmpty, lastIndexOf, move, primitiveGet, remove, removeAll, setUnique, size, startLogEvents, stopLogEvents, validateMethods inherited from class org.eclipse.emf.ecore.util.EObjectEList
canContainNull, getFeatureID, isEObject, isUnique, resolve, useEqualsMethods 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, resolveProxy, set, toArray, toArray, unsetMethods inherited from class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl
basicIterator, basicListIterator, basicListIteratorMethods inherited from class org.eclipse.emf.common.notify.impl.NotifyingListImpl
addAllUnique, addAllUnique, addAllUnique, basicRemove, createNotification, createNotificationChain, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddUnique, doAddUnique, doClear, doRemoveAll, doSetUnique, getFeatureID, hasShadow, shadowAdd, shadowRemove, shadowSetMethods inherited from class org.eclipse.emf.common.util.BasicEList
clone, data, grow, setData, shrinkMethods inherited from class org.eclipse.emf.common.util.AbstractEList
didAdd, didChange, didClear, didMove, didSet, equalObjects, equals, getDuplicates, getNonDuplicates, hashCode, iterator, listIterator, listIterator, move, remove, retainAll, toStringMethods inherited from class java.util.AbstractList
removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
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, basicIterator, basicListIterator, basicListIterator, basicRemoveMethods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, replaceAll, retainAll, 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.
-
-
Constructor Details
-
SubsetSupersetEObjectEList
public SubsetSupersetEObjectEList(Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, @CheckForNull int[] supersetFeatureIDs, @CheckForNull int[] subsetFeatureIDs) Creates and initializes a newModelEObjectEListinstance.- Parameters:
dataClass- data class.owner- owner of the setting.featureID- feature id.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.
-
basicSupersetAdd
protected void basicSupersetAdd(Object object, org.eclipse.emf.common.notify.NotificationChain notifications) Adds the specified element to the superset(s). Similar to supersetAdd, but does basicAdd in order to avoid other end setting without "containts" check- Parameters:
object- The element to be added.- See Also:
-
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.NotifyingListImpl<E>
-
add
-
add
-
addAll
-
addAll
-
set
-
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.
-
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) - Overrides:
resolvein classorg.eclipse.emf.ecore.util.EcoreEList<E>
-