org.eclipse.emf.ecore.util
Class DelegatingEcoreEList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byorg.eclipse.emf.common.util.DelegatingEList
              extended byorg.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl
                  extended byorg.eclipse.emf.ecore.util.DelegatingEcoreEList
All Implemented Interfaces:
Cloneable, Collection, EList, EStructuralFeature.Setting, InternalEList, InternalEList.Unsettable, List, NotifyingList, Serializable
Direct Known Subclasses:
DelegatingEcoreEList.Generic, DelegatingEcoreEList.Unsettable, DelegatingFeatureMap

public abstract class DelegatingEcoreEList
extends DelegatingNotifyingListImpl
implements InternalEList.Unsettable, EStructuralFeature.Setting

See Also:
Serialized Form

Nested Class Summary
static class DelegatingEcoreEList.Dynamic
           
static class DelegatingEcoreEList.Generic
           
static class DelegatingEcoreEList.UnmodifiableEList
           
static class DelegatingEcoreEList.Unsettable
           
 
Nested classes inherited from class org.eclipse.emf.common.util.DelegatingEList
DelegatingEList.EIterator, DelegatingEList.EListIterator, DelegatingEList.NonResolvingEIterator, DelegatingEList.NonResolvingEListIterator
 
Field Summary
protected  InternalEObject owner
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DelegatingEcoreEList(InternalEObject owner)
           
 
Method Summary
 Object basicGet(int index)
          Returns the unresolved value.
 Iterator basicIterator()
          Returns an iterator that yields unresolved values.
 List basicList()
          Returns an unmodifiable list that yields unresolved values.
 ListIterator basicListIterator()
          Returns a list iterator that yields unresolved values.
 ListIterator basicListIterator(int index)
          Returns a list iterator that yields unresolved values.
protected  boolean canContainNull()
          Returns !
 boolean contains(Object object)
          Resolve to compare objects but do not modify list
protected  NotificationImpl createNotification(int eventType, boolean oldValue, boolean newValue)
           
protected  NotificationImpl createNotification(int eventType, Object oldObject, Object newObject, int index, boolean wasSet)
          Creates a notification.
protected  void dispatchNotification(Notification notification)
          Dispatches a notification to the notifier of the list.
 Object get(boolean resolve)
          Returns the value held by the feature of the object; it optionally resolves the value.
 EObject getEObject()
          Returns the object holding a value.
 EStructuralFeature getEStructuralFeature()
          Returns the specific feature holding a value for the object.
 Object getFeature()
          Returns null.
 int getFeatureID()
          Returns Notification.NO_FEATURE_ID.
protected  EClassifier getFeatureType()
           
protected  EReference getInverseEReference()
           
protected  Class getInverseFeatureClass()
           
protected  int getInverseFeatureID()
           
 Object getNotifier()
          Returns null.
protected  boolean hasInstanceClass()
           
protected  boolean hasInverse()
          Returns false.
protected  boolean hasManyInverse()
           
protected  boolean hasNavigableInverse()
           
protected  boolean hasProxies()
           
 int indexOf(Object object)
          Returns the position of the first occurrence of the object in the list.
 NotificationChain inverseAdd(Object object, NotificationChain notifications)
          Does nothing and returns the notifications.
 NotificationChain inverseRemove(Object object, NotificationChain notifications)
          Does nothing and returns the notifications.
protected  boolean isContainment()
           
protected  boolean isEObject()
           
protected  boolean isInstance(Object object)
           
protected  boolean isNotificationRequired()
          Returns false.
 boolean isSet()
          Returns whether a value is held by the feature of the object.
protected  boolean isUnique()
          Returns whether objects are constrained to appear at most once in the list.
 int lastIndexOf(Object object)
          Returns the position of the last occurrence of the object in the list.
protected  Object resolve(int index, Object object)
          Resolves the object at the index and returns the result.
protected  Object resolve(Object object)
          Returns the resolved object from this list for the purpose of testing whether DelegatingNotifyingListImpl.removeAll(Collection) applies to it.
protected  EObject resolveProxy(EObject eObject)
           
 void set(Object newValue)
          Set the value held by the feature of the object.
 Object[] toArray()
          Returns an array containing all the objects in sequence.
 Object[] toArray(Object[] array)
          Returns an array containing all the objects in sequence.
 void unset()
          Unsets the value held by the feature of the object.
protected  Object validate(int index, Object object)
          Validates a new content object and returns the validated object.
 
Methods inherited from class org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl
addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, basicAdd, basicRemove, basicSet, 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.DelegatingEList
add, add, addAll, addAll, containsAll, delegateAdd, delegateAdd, delegateBasicList, delegateClear, delegateContains, delegateContainsAll, delegateEquals, delegateGet, delegateHashCode, delegateIndexOf, delegateIsEmpty, delegateIterator, delegateLastIndexOf, delegateList, delegateListIterator, delegateRemove, delegateSet, delegateSize, delegateToArray, delegateToArray, delegateToString, didAdd, didChange, didClear, didMove, didRemove, didSet, doClear, equalObjects, equals, get, getDuplicates, getNonDuplicates, hashCode, isEmpty, iterator, listIterator, listIterator, move, remove, retainAll, set, size, toString, useEquals
 
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 org.eclipse.emf.ecore.util.InternalEList
addUnique, addUnique, basicAdd, basicRemove, setUnique
 
Methods inherited from interface org.eclipse.emf.common.util.EList
move, move
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, containsAll, equals, get, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList
 

Field Detail

owner

protected final InternalEObject owner
Constructor Detail

DelegatingEcoreEList

public DelegatingEcoreEList(InternalEObject owner)
Method Detail

canContainNull

protected boolean canContainNull()
Description copied from class: DelegatingNotifyingListImpl
Returns !DelegatingNotifyingListImpl.hasInverse().

Overrides:
canContainNull in class DelegatingNotifyingListImpl
Returns:
!hasInverse.

isUnique

protected boolean isUnique()
Description copied from class: DelegatingEList
Returns whether objects are constrained to appear at most once in the list. The default is to return false, but clients can override this to ensure uniqueness of contents. The performance impact is signifcant: operations such as add are O(n) as a result requiring uniqueness.

Overrides:
isUnique in class DelegatingEList
Returns:
whether objects are constrained to appear at most once in the list.

hasInverse

protected boolean hasInverse()
Description copied from class: DelegatingNotifyingListImpl
Returns false.

Overrides:
hasInverse in class DelegatingNotifyingListImpl
Returns:
false.

validate

protected Object validate(int index,
                          Object object)
Description copied from class: DelegatingEList
Validates a new content object and returns the validated object. This implementation checks for null, if necessary and returns the argument object. Clients may throw additional types of runtime exceptions in order to handle constraint violations.

Overrides:
validate in class DelegatingEList
Parameters:
index - the position of the new content.
object - the new content.
Returns:
the validated content.

isInstance

protected boolean isInstance(Object object)

getNotifier

public Object getNotifier()
Description copied from class: DelegatingNotifyingListImpl
Returns null.

Specified by:
getNotifier in interface NotifyingList
Overrides:
getNotifier in class DelegatingNotifyingListImpl
Returns:
null.

getFeature

public Object getFeature()
Description copied from class: DelegatingNotifyingListImpl
Returns null.

Specified by:
getFeature in interface NotifyingList
Overrides:
getFeature in class DelegatingNotifyingListImpl
Returns:
null.

getFeatureID

public int getFeatureID()
Description copied from class: DelegatingNotifyingListImpl
Returns Notification.NO_FEATURE_ID.

Specified by:
getFeatureID in interface NotifyingList
Overrides:
getFeatureID in class DelegatingNotifyingListImpl
Returns:
Notification.NO_FEATURE_ID.

getEStructuralFeature

public EStructuralFeature getEStructuralFeature()
Description copied from interface: EStructuralFeature.Setting
Returns the specific feature holding a value for the object.

Specified by:
getEStructuralFeature in interface EStructuralFeature.Setting
Returns:
the specific feature holding a value for the object.

getFeatureType

protected EClassifier getFeatureType()

getInverseEReference

protected EReference getInverseEReference()

getInverseFeatureID

protected int getInverseFeatureID()

getInverseFeatureClass

protected Class getInverseFeatureClass()

hasManyInverse

protected boolean hasManyInverse()

hasNavigableInverse

protected boolean hasNavigableInverse()

isEObject

protected boolean isEObject()

isContainment

protected boolean isContainment()

hasProxies

protected boolean hasProxies()

hasInstanceClass

protected boolean hasInstanceClass()

resolve

protected Object resolve(int index,
                         Object object)
Description copied from class: DelegatingEList
Resolves the object at the index and returns the result. This implementation simply returns the object; clients can use this to transform objects as they are fetched.

Overrides:
resolve in class DelegatingEList
Parameters:
index - the position of the content.
object - the content.
Returns:
the resolved object.

resolve

protected Object resolve(Object object)
Description copied from class: DelegatingNotifyingListImpl
Returns the resolved object from this list for the purpose of testing whether DelegatingNotifyingListImpl.removeAll(Collection) applies to it.

Overrides:
resolve in class DelegatingNotifyingListImpl
Parameters:
object - the object to be resolved.
Returns:
the resolved object from this list for the purpose of testing whether removeAll applies to it.

resolveProxy

protected EObject resolveProxy(EObject eObject)

toArray

public Object[] toArray()
Description copied from class: DelegatingEList
Returns an array containing all the objects in sequence.

Specified by:
toArray in interface List
Overrides:
toArray in class DelegatingEList
Returns:
an array containing all the objects in sequence.

toArray

public Object[] toArray(Object[] array)
Description copied from class: DelegatingEList
Returns an array containing all the objects in sequence.

Specified by:
toArray in interface List
Overrides:
toArray in class DelegatingEList
Parameters:
array - the array that will be filled and returned, if it's big enough; otherwise, a suitably large array of the same type will be allocated and used instead.
Returns:
an array containing all the objects in sequence.

createNotification

protected NotificationImpl createNotification(int eventType,
                                              Object oldObject,
                                              Object newObject,
                                              int index,
                                              boolean wasSet)
Description copied from class: DelegatingNotifyingListImpl
Creates a notification.

Overrides:
createNotification in class DelegatingNotifyingListImpl
Parameters:
eventType - the type of change that has occurred.
oldObject - the value of the notifier's feature before the change occurred.
newObject - the value of the notifier's feature after the change occurred.
index - the position at which the change occurred.
Returns:
a new notification.

createNotification

protected NotificationImpl createNotification(int eventType,
                                              boolean oldValue,
                                              boolean newValue)

dispatchNotification

protected void dispatchNotification(Notification notification)
Description copied from class: DelegatingNotifyingListImpl
Dispatches a notification to the notifier of the list.

Overrides:
dispatchNotification in class DelegatingNotifyingListImpl
Parameters:
notification - the notification to dispatch.

basicGet

public Object basicGet(int index)
Description copied from interface: InternalEList
Returns the unresolved value.

Specified by:
basicGet in interface InternalEList
Overrides:
basicGet in class DelegatingEList
Parameters:
index - the position in question.
Returns:
the object at the index.
See Also:
DelegatingEList.resolve(int, java.lang.Object), DelegatingEList.get(int)

basicList

public List basicList()
Description copied from interface: InternalEList
Returns an unmodifiable list that yields unresolved values.

Specified by:
basicList in interface InternalEList
Overrides:
basicList in class DelegatingEList
Returns:
an unsafe list that provides a non-resolving view of the backign store list.

isNotificationRequired

protected boolean isNotificationRequired()
Description copied from class: DelegatingNotifyingListImpl
Returns false.

Overrides:
isNotificationRequired in class DelegatingNotifyingListImpl
Returns:
false.

inverseAdd

public NotificationChain inverseAdd(Object object,
                                    NotificationChain notifications)
Description copied from class: DelegatingNotifyingListImpl
Does nothing and returns the notifications. Clients can override this to update the inverse of a bidirectional relation.

Overrides:
inverseAdd in class DelegatingNotifyingListImpl
Parameters:
object - the object that's been added to the list.
notifications - the chain of accumulating notifications.
Returns:
the notifications.

inverseRemove

public NotificationChain inverseRemove(Object object,
                                       NotificationChain notifications)
Description copied from class: DelegatingNotifyingListImpl
Does nothing and returns the notifications. Clients can override this to update the inverse of a bidirectional relation.

Overrides:
inverseRemove in class DelegatingNotifyingListImpl
Parameters:
object - the object that's been remove from the list.
notifications - the chain of accumulating notifications.
Returns:
the notifications.

contains

public boolean contains(Object object)
Resolve to compare objects but do not modify list

Specified by:
contains in interface List
Overrides:
contains in class DelegatingEList
Parameters:
object - the object in question.
Returns:
whether the list contains the object.

indexOf

public int indexOf(Object object)
Description copied from class: DelegatingEList
Returns the position of the first occurrence of the object in the list.

Specified by:
indexOf in interface List
Overrides:
indexOf in class DelegatingEList
Parameters:
object - the object in question.
Returns:
the position of the first occurrence of the object in the list.

lastIndexOf

public int lastIndexOf(Object object)
Description copied from class: DelegatingEList
Returns the position of the last occurrence of the object in the list.

Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class DelegatingEList
Parameters:
object - the object in question.
Returns:
the position of the last occurrence of the object in the list.

basicIterator

public Iterator basicIterator()
Description copied from interface: InternalEList
Returns an iterator that yields unresolved values.

Specified by:
basicIterator in interface InternalEList
Overrides:
basicIterator in class DelegatingEList
Returns:
a read-only iterator that does not resolve objects.

basicListIterator

public ListIterator basicListIterator()
Description copied from interface: InternalEList
Returns a list iterator that yields unresolved values.

Specified by:
basicListIterator in interface InternalEList
Overrides:
basicListIterator in class DelegatingEList
Returns:
a read-only list iterator that does not resolve objects.

basicListIterator

public ListIterator basicListIterator(int index)
Description copied from interface: InternalEList
Returns a list iterator that yields unresolved values.

Specified by:
basicListIterator in interface InternalEList
Overrides:
basicListIterator in class DelegatingEList
Parameters:
index - the starting index.
Returns:
a read-only list iterator advanced to the index.

getEObject

public EObject getEObject()
Description copied from interface: EStructuralFeature.Setting
Returns the object holding a value.

Specified by:
getEObject in interface EStructuralFeature.Setting
Returns:
the object holding a value.

get

public Object get(boolean resolve)
Description copied from interface: EStructuralFeature.Setting
Returns the value held by the feature of the object; it optionally resolves the value.

Specified by:
get in interface EStructuralFeature.Setting
Parameters:
resolve - whether to resolve.
Returns:
the value held by the feature of the object.
See Also:
EObject.eGet(EStructuralFeature, boolean)

set

public void set(Object newValue)
Description copied from interface: EStructuralFeature.Setting
Set the value held by the feature of the object. If the new value is this setting itself, or is modified as a side effect of modifying this setting (i.e., if it is a view on the setting), the behavior is undefined and will likely result in simply clearing the list.

Specified by:
set in interface EStructuralFeature.Setting
Parameters:
newValue - the newValue.
See Also:
EObject.eSet(EStructuralFeature, Object)

isSet

public boolean isSet()
Description copied from interface: InternalEList.Unsettable
Returns whether a value is held by the feature of the object.

Specified by:
isSet in interface InternalEList.Unsettable
Overrides:
isSet in class DelegatingNotifyingListImpl
Returns:
whether the list is considered set.

unset

public void unset()
Description copied from interface: InternalEList.Unsettable
Unsets the value held by the feature of the object.

Specified by:
unset in interface InternalEList.Unsettable
See Also:
EObject.eUnset(org.eclipse.emf.ecore.EStructuralFeature)

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.