org.eclipse.uml2.common.util
Class SubsetSupersetEObjectEList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.eclipse.emf.common.util.AbstractEList<E>
              extended by org.eclipse.emf.common.util.BasicEList<E>
                  extended by org.eclipse.emf.common.notify.impl.NotifyingListImpl<E>
                      extended by org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
                          extended by org.eclipse.emf.ecore.util.EcoreEList<E>
                              extended by org.eclipse.emf.ecore.util.EObjectEList<E>
                                  extended by org.eclipse.uml2.common.util.SubsetSupersetEObjectEList<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:
SubsetSupersetEObjectContainmentEList, SubsetSupersetEObjectEList.Unsettable, SubsetSupersetEObjectResolvingEList, SubsetSupersetEObjectWithInverseEList

public class SubsetSupersetEObjectEList<E>
extends org.eclipse.emf.ecore.util.EObjectEList<E>

A list that enforces subset/superset consraints. 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
static class SubsetSupersetEObjectEList.Unsettable<E>
           
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.EcoreEList
org.eclipse.emf.ecore.util.EcoreEList.Dynamic<E>, org.eclipse.emf.ecore.util.EcoreEList.Generic<E>, org.eclipse.emf.ecore.util.EcoreEList.UnmodifiableEList<E>
 
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>, org.eclipse.emf.common.util.BasicEList.EListIterator<E1>, org.eclipse.emf.common.util.BasicEList.FastCompare<E>, org.eclipse.emf.common.util.BasicEList.NonResolvingEIterator<E1>, org.eclipse.emf.common.util.BasicEList.NonResolvingEListIterator<E1>
 
Field Summary
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.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
SubsetSupersetEObjectEList(java.lang.Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, int[] supersetFeatureIDs, int[] subsetFeatureIDs)
           
 
Method Summary
 boolean add(E object)
           
 void add(int index, E object)
           
 boolean addAll(java.util.Collection<? extends E> collection)
           
 boolean addAll(int index, 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.
 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.EObjectEList
canContainNull, getFeatureID, hasInverse, isEObject, isUnique, resolve, useEquals
 
Methods inherited from class org.eclipse.emf.ecore.util.EcoreEList
contains, createNotification, createNotification, dispatchNotification, get, getEObject, getEStructuralFeature, getFeature, getFeatureType, getInverseEReference, getInverseFeatureClass, getInverseFeatureID, getNotifier, hasInstanceClass, hasManyInverse, hasNavigableInverse, hasProxies, indexOf, inverseAdd, inverseRemove, isContainment, isInstance, isNotificationRequired, isSet, lastIndexOf, newData, resolve, resolve, resolveProxy, set, toArray, toArray, unset, validate
 
Methods inherited from class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl
basicContains, basicContainsAll, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArray
 
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifyingListImpl
addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, basicRemove, clear, createNotification, createNotificationChain, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddUnique, doAddUnique, doClear, doMove, doRemove, doRemoveAll, doSetUnique, getFeatureID, hasShadow, move, remove, removeAll, setUnique, shadowAdd, shadowRemove, shadowSet
 
Methods inherited from class org.eclipse.emf.common.util.BasicEList
assign, basicGet, clone, data, get, grow, isEmpty, primitiveGet, setData, shrink, size
 
Methods 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, 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 org.eclipse.emf.ecore.util.InternalEList
addAllUnique, addAllUnique, addUnique, addUnique, basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicRemove, basicToArray, basicToArray, setUnique
 
Methods inherited from interface org.eclipse.emf.common.util.EList
move, move
 
Methods inherited from interface java.util.List
clear, containsAll, equals, get, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, removeAll, retainAll, size, 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.

Constructor Detail

SubsetSupersetEObjectEList

public SubsetSupersetEObjectEList(java.lang.Class<?> dataClass,
                                  org.eclipse.emf.ecore.InternalEObject owner,
                                  int featureID,
                                  int[] supersetFeatureIDs,
                                  int[] subsetFeatureIDs)
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.

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.NotifyingListImpl<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.NotifyingListImpl<E>

add

public void add(int index,
                E object)
Specified by:
add in interface java.util.List<E>
Overrides:
add in class org.eclipse.emf.common.util.AbstractEList<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>

Copyright 2003, 2014 IBM Corporation, CEA, and others.
All Rights Reserved.