org.eclipse.emf.ecore.util
Class EcoreEList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--org.eclipse.emf.common.util.BasicEList
                    |
                    +--org.eclipse.emf.common.notify.impl.NotifyingListImpl
                          |
                          +--org.eclipse.emf.ecore.util.EcoreEList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, EList, EStructuralFeature.Setting, EStructuralFeature.Setting.Internal, InternalEList, java.util.List, NotifyingList, java.io.Serializable
Direct Known Subclasses:
EcoreDynamicEList, EDataTypeEList, EObjectEList

public class EcoreEList
extends NotifyingListImpl
implements InternalEList, EStructuralFeature.Setting.Internal

See Also:
Serialized Form

Inner Class Summary
static class EcoreEList.UnmodifiableEList
           
 
Inner classes inherited from class org.eclipse.emf.common.util.BasicEList
BasicEList.EIterator, BasicEList.EListIterator, BasicEList.NonResolvingEIterator, BasicEList.NonResolvingEListIterator, BasicEList.UnmodifiableEList
 
Inner classes inherited from class org.eclipse.emf.ecore.EStructuralFeature.Setting
EStructuralFeature.Setting.Internal
 
Field Summary
protected  java.lang.Class dataClass
           
protected  InternalEObject owner
           
 
Fields inherited from class org.eclipse.emf.common.util.BasicEList
data, size
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
EcoreEList(java.lang.Class dataClass, InternalEObject owner)
           
 
Method Summary
 java.util.Iterator basicIterator()
          Returns an iterator that yields unresolved values.
 java.util.List basicList()
          Returns an unmodifiable list that yields unresolved values.
 java.util.ListIterator basicListIterator()
          Returns a list iterator that yields unresolved values.
 java.util.ListIterator basicListIterator(int index)
          Returns a list iterator that yields unresolved values.
 boolean contains(java.lang.Object object)
          Resolve to compare objects but do not modify list
protected  Notification createNotification(int eventType, boolean oldValue, boolean newValue)
           
protected  Notification createNotification(int eventType, java.lang.Object oldObject, java.lang.Object newObject, int index)
          Creates a notification.
protected  void dispatchNotification(Notification notification)
          Dispatches a notification to the notifier of the list.
 java.lang.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.
 java.lang.Object getFeature()
          Returns null.
 int getFeatureID()
          Returns Notification.NO_FEATURE_ID.
 EStructuralFeature getInverseEStructuralFeature()
           
 java.lang.Class getInverseFeatureClass()
           
 int getInverseFeatureID()
           
 java.lang.Object getNotifier()
          Returns null.
protected  boolean hasManyInverse()
           
protected  boolean hasNavigableInverse()
           
protected  boolean hasProxies()
           
 int indexOf(java.lang.Object object)
          Returns the position of the first occurrence of the object in the list.
 NotificationChain inverseAdd(java.lang.Object object, NotificationChain notifications)
          Does nothing and returns the notifications.
 NotificationChain inverseRemove(java.lang.Object object, NotificationChain notifications)
          Does nothing and returns the notifications.
protected  boolean isContainment()
           
protected  boolean isEObject()
           
protected  boolean isNotificationRequired()
          Returns false.
 boolean isSet()
          Returns whether a value is held by the feature of the object.
 int lastIndexOf(java.lang.Object object)
          Returns the position of the last occurrence of the object in the list.
protected  java.lang.Object[] newData(int capacity)
          Returns new allocated data storage.
protected  java.lang.Object resolve(int index, java.lang.Object object)
          Resolves the object at the index and returns the result.
protected  EObject resolveProxy(EObject eObject)
           
 void set(java.lang.Object newValue)
          Set the value held by the feature of the object.
 java.lang.Object[] toArray()
          Returns an array containing all the objects in sequence.
 java.lang.Object[] toArray(java.lang.Object[] array)
          Returns an array containing all the objects in sequence.
 void unset()
          Unsets the value held by the feature of the object.
 
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifyingListImpl
addAllUnique, addAllUnique, addUnique, addUnique, basicAdd, basicRemove, basicSet, canContainNull, clear, createNotificationChain, getFeatureID, hasInverse, move, remove, removeAll, setUnique
 
Methods inherited from class org.eclipse.emf.common.util.BasicEList
add, add, addAll, addAll, assign, clone, containsAll, data, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, get, getDuplicates, getNonDuplicates, grow, hashCode, isEmpty, isUnique, iterator, listIterator, listIterator, move, remove, retainAll, set, shrink, size, toString, useEquals, validate
 
Methods inherited from class java.util.AbstractList
removeRange, subList
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.ecore.util.InternalEList
addUnique, addUnique, basicAdd, basicRemove
 
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
 
Methods inherited from interface org.eclipse.emf.ecore.EStructuralFeature.Setting.Internal
basicAdd, basicRemove
 

Field Detail

dataClass

protected java.lang.Class dataClass

owner

protected InternalEObject owner
Constructor Detail

EcoreEList

public EcoreEList(java.lang.Class dataClass,
                  InternalEObject owner)
Method Detail

newData

protected java.lang.Object[] newData(int capacity)
Description copied from class: BasicEList
Returns new allocated data storage. Clients may override this to create typed storage. The cost of type checking via a typed array is negligable.
Overrides:
newData in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Returns:
new data storage.

getNotifier

public java.lang.Object getNotifier()
Description copied from class: NotifyingListImpl
Returns null.
Overrides:
getNotifier in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Returns:
null.

getFeature

public java.lang.Object getFeature()
Description copied from class: NotifyingListImpl
Returns null.
Overrides:
getFeature in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Returns:
null.

getFeatureID

public int getFeatureID()
Description copied from class: NotifyingListImpl
Returns Notification.NO_FEATURE_ID.
Overrides:
getFeatureID in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
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
Following copied from interface: org.eclipse.emf.ecore.EStructuralFeature.Setting
Returns:
the specific feature holding a value for the object.

getInverseEStructuralFeature

public EStructuralFeature getInverseEStructuralFeature()

getInverseFeatureID

public int getInverseFeatureID()

getInverseFeatureClass

public java.lang.Class getInverseFeatureClass()

hasManyInverse

protected boolean hasManyInverse()

hasNavigableInverse

protected boolean hasNavigableInverse()

isEObject

protected boolean isEObject()

isContainment

protected boolean isContainment()

hasProxies

protected boolean hasProxies()

resolve

protected java.lang.Object resolve(int index,
                                   java.lang.Object object)
Description copied from class: BasicEList
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 BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Parameters:
index - the position of the content.
object - the content.
Returns:
the resolved object.

resolveProxy

protected EObject resolveProxy(EObject eObject)

toArray

public java.lang.Object[] toArray()
Description copied from class: BasicEList
Returns an array containing all the objects in sequence. Clients may override newData to create typed storage in this case.
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Returns:
an array containing all the objects in sequence.
See Also:
BasicEList.newData(int)

toArray

public java.lang.Object[] toArray(java.lang.Object[] array)
Description copied from class: BasicEList
Returns an array containing all the objects in sequence.
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
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.
See Also:
BasicEList.newData(int)

createNotification

protected Notification createNotification(int eventType,
                                          java.lang.Object oldObject,
                                          java.lang.Object newObject,
                                          int index)
Description copied from class: NotifyingListImpl
Creates a notification.
Overrides:
createNotification in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Parameters:
eventType - the type of change that has occurred.
oldValue - the value of the notifier's feature before the change occurred.
newValue - 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 Notification createNotification(int eventType,
                                          boolean oldValue,
                                          boolean newValue)

dispatchNotification

protected void dispatchNotification(Notification notification)
Description copied from class: NotifyingListImpl
Dispatches a notification to the notifier of the list.
Overrides:
dispatchNotification in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Parameters:
notification - the notification to dispatch.

basicList

public java.util.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 BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Returns:
an unsafe list that provides a non-resolving view of the underlying data storage.

isNotificationRequired

protected boolean isNotificationRequired()
Description copied from class: NotifyingListImpl
Returns false.
Overrides:
isNotificationRequired in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Returns:
false.

inverseAdd

public NotificationChain inverseAdd(java.lang.Object object,
                                    NotificationChain notifications)
Description copied from class: NotifyingListImpl
Does nothing and returns the notifications. Clients can override this to update the inverse of a bidirectional relation.
Overrides:
inverseAdd in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Parameters:
object - the object that's been added to the list.
notifications - the chain of accumulating notifications.
Returns:
the notifications.

inverseRemove

public NotificationChain inverseRemove(java.lang.Object object,
                                       NotificationChain notifications)
Description copied from class: NotifyingListImpl
Does nothing and returns the notifications. Clients can override this to update the inverse of a bidirectional relation.
Overrides:
inverseRemove in class NotifyingListImpl
Following copied from class: org.eclipse.emf.common.notify.impl.NotifyingListImpl
Parameters:
object - the object that's been remove from the list.
notifications - the chain of accumulating notifications.
Returns:
the notifications.

contains

public boolean contains(java.lang.Object object)
Resolve to compare objects but do not modify list
Specified by:
contains in interface java.util.List
Overrides:
contains in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Parameters:
object - the object in question.
Returns:
whether the list contains the object.
See Also:
BasicEList.useEquals()

indexOf

public int indexOf(java.lang.Object object)
Description copied from class: BasicEList
Returns the position of the first occurrence of the object in the list. This implementation uses either equals or "==" depending on useEquals.
Specified by:
indexOf in interface java.util.List
Overrides:
indexOf in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Parameters:
object - the object in question.
Returns:
the position of the first occurrence of the object in the list.

lastIndexOf

public int lastIndexOf(java.lang.Object object)
Description copied from class: BasicEList
Returns the position of the last occurrence of the object in the list. This implementation uses either equals or "==" depending on useEquals.
Specified by:
lastIndexOf in interface java.util.List
Overrides:
lastIndexOf in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Parameters:
object - the object in question.
Returns:
the position of the last occurrence of the object in the list.

basicIterator

public java.util.Iterator basicIterator()
Description copied from interface: InternalEList
Returns an iterator that yields unresolved values.
Specified by:
basicIterator in interface InternalEList
Overrides:
basicIterator in class BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Returns:
a read-only iterator that does not resolve objects.

basicListIterator

public java.util.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 BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Returns:
a read-only list iterator that does not resolve objects.

basicListIterator

public java.util.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 BasicEList
Following copied from class: org.eclipse.emf.common.util.BasicEList
Parameters:
index - the starting index.
Returns:
a read-only list iterator advanced to the index.
Throws:
java.lang.IndexOutOfBoundsException - if the index isn't within the size range.

getEObject

public EObject getEObject()
Description copied from interface: EStructuralFeature.Setting
Returns the object holding a value.
Specified by:
getEObject in interface EStructuralFeature.Setting
Following copied from interface: org.eclipse.emf.ecore.EStructuralFeature.Setting
Returns:
the object holding a value.

get

public java.lang.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
Following copied from interface: org.eclipse.emf.ecore.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(java.lang.Object newValue)
Description copied from interface: EStructuralFeature.Setting
Set the value held by the feature of the object.
Specified by:
set in interface EStructuralFeature.Setting
Following copied from interface: org.eclipse.emf.ecore.EStructuralFeature.Setting
Parameters:
newValue - the newValue.
See Also:
EObject.eSet(EStructuralFeature, Object)

isSet

public boolean isSet()
Description copied from interface: EStructuralFeature.Setting
Returns whether a value is held by the feature of the object.
Specified by:
isSet in interface EStructuralFeature.Setting
Following copied from interface: org.eclipse.emf.ecore.EStructuralFeature.Setting
Returns:
whether a value is held by the feature of the object.
See Also:
EObject.eIsSet(EStructuralFeature)

unset

public void unset()
Description copied from interface: EStructuralFeature.Setting
Unsets the value held by the feature of the object.
Specified by:
unset in interface EStructuralFeature.Setting
Following copied from interface: org.eclipse.emf.ecore.EStructuralFeature.Setting
See Also:
EObject.eUnset(EStructuralFeature)

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