Class ModifiableDerivedUnionEObjectEList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
org.eclipse.emf.ecore.util.AbstractSequentialInternalEList<E>
org.eclipse.uml2.common.util.DerivedEObjectEList<E>
org.eclipse.uml2.common.util.DerivedUnionEObjectEList<E>
com.nomagic.magicdraw.uml2.util.ModifiableDerivedUnionEObjectEList<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<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>

public class ModifiableDerivedUnionEObjectEList<E> extends org.eclipse.uml2.common.util.DerivedUnionEObjectEList<E>
A derived list representing a union of all the elements from its source features. This list is ideal for implementing derived union features.
  • Constructor Details

    • ModifiableDerivedUnionEObjectEList

      public ModifiableDerivedUnionEObjectEList(Class<?> dataClass, org.eclipse.emf.ecore.InternalEObject owner, int featureID, int[] sourceFeatureIDs)
      Creates and initializes a new DerivedUnionEObjectEStoreEList from specified parameters.
      Parameters:
      dataClass - class of objects which will be stored in the collection.
      owner - owner of the collection.
      featureID - feature which value this list represents ID.
      sourceFeatureIDs - identifiers of features that compose values of this list.
  • Method Details

    • add

      public boolean add(E e)
      Appends the specified element to the end of this list (optional operation).

      Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.

      This implementation calls add(size(), e).

      Note that this implementation throws an UnsupportedOperationException unless add(int, E) is overridden.

      Specified by:
      add in interface Collection<E>
      Specified by:
      add in interface List<E>
      Overrides:
      add in class AbstractList<E>
      Parameters:
      e - element to be appended to this list
      Returns:
      true (as specified by Collection.add(E))
      Throws:
      UnsupportedOperationException - if the add operation is not supported by this list
      ClassCastException - if the class of the specified element prevents it from being added to this list
      NullPointerException - if the specified element is null and this list does not permit null elements
      IllegalArgumentException - if some property of this element prevents it from being added to this list
    • move

      public E move(int newPosition, int oldPosition)
      Move is not supported however the method returns value at old index.
      Specified by:
      move in interface org.eclipse.emf.common.util.EList<E>
      Overrides:
      move in class org.eclipse.emf.ecore.util.AbstractSequentialInternalEList<E>
      Parameters:
      newPosition - new position.
      oldPosition - old position.
      Returns:
      value at old position.
    • move

      public void move(int newPosition, E object)
      Does nothing. Move is not supported.
      Specified by:
      move in interface org.eclipse.emf.common.util.EList<E>
      Overrides:
      move in class org.eclipse.emf.ecore.util.AbstractSequentialInternalEList<E>
      Parameters:
      newPosition - new position.
      object - an object to move.
    • remove

      public boolean remove(Object obj)
      Specified by:
      remove in interface Collection<E>
      Specified by:
      remove in interface List<E>
      Overrides:
      remove in class AbstractCollection<E>
    • contains

      public boolean contains(Object object)
      The method is copied from supper and fixed casting to Collection instead of List.
      Specified by:
      contains in interface Collection<E>
      Specified by:
      contains in interface List<E>
      Overrides:
      contains in class org.eclipse.uml2.common.util.DerivedEObjectEList<E>
      Parameters:
      object - an object.
      Returns:
      true if the collection contains the object, otherwise - false.
    • newListIterator

      protected ListIterator<E> newListIterator()
      Overrides:
      newListIterator in class org.eclipse.uml2.common.util.DerivedEObjectEList<E>
    • newResolvingListIterator

      protected ListIterator<E> newResolvingListIterator()
      Overrides:
      newResolvingListIterator in class org.eclipse.uml2.common.util.DerivedEObjectEList<E>
    • newEmptyListIterator

      protected ListIterator<E> newEmptyListIterator()
      Overrides:
      newEmptyListIterator in class org.eclipse.uml2.common.util.DerivedEObjectEList<E>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<E>
      Specified by:
      isEmpty in interface List<E>
      Overrides:
      isEmpty in class org.eclipse.uml2.common.util.DerivedEObjectEList<E>
    • snapshot

      public List<E> snapshot()