public abstract class DelegatingEcoreEList<E> extends DelegatingNotifyingInternalEListImpl<E> implements InternalEList.Unsettable<E>, EStructuralFeature.Setting
delegating notifying internal EList
that implements InternalEList.Unsettable
and EStructuralFeature.Setting
.
At least one of getEStructuralFeature()
or getFeatureID()
must be specialized
since each delegates to the other and without specialization this will lead to stack overflow.Modifier and Type | Class and Description |
---|---|
static class |
DelegatingEcoreEList.Dynamic<E> |
static class |
DelegatingEcoreEList.Generic<E> |
static class |
DelegatingEcoreEList.UnmodifiableEList<E> |
static class |
DelegatingEcoreEList.Unsettable<E>
A
delegating Ecore EList with an implementation for tracking the unset state. |
DelegatingEList.EIterator<E1>, DelegatingEList.EListIterator<E1>, DelegatingEList.NonResolvingEIterator<E1>, DelegatingEList.NonResolvingEListIterator<E1>
AbstractEList.BasicIndexOutOfBoundsException
Modifier and Type | Field and Description |
---|---|
protected InternalEObject |
owner |
Constructor and Description |
---|
DelegatingEcoreEList(InternalEObject owner) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canContainNull()
Returns
! |
boolean |
contains(java.lang.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,
java.lang.Object oldObject,
java.lang.Object newObject,
int index,
boolean wasSet)
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 . |
protected EClassifier |
getFeatureType() |
protected EReference |
getInverseEReference() |
protected java.lang.Class<?> |
getInverseFeatureClass() |
protected int |
getInverseFeatureID() |
java.lang.Object |
getNotifier()
Returns
null . |
protected boolean |
hasInstanceClass() |
protected boolean |
hasInverse()
Returns
false . |
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(E object,
NotificationChain notifications)
Does nothing and returns the
notifications . |
NotificationChain |
inverseRemove(E object,
NotificationChain notifications)
Does nothing and returns the
notifications . |
protected boolean |
isContainment() |
protected boolean |
isEObject() |
protected boolean |
isInstance(java.lang.Object object) |
protected boolean |
isNotificationRequired()
Returns
false . |
boolean |
isSet()
Returns whether the list is considered set, i.e., whether it's not empty.
|
protected boolean |
isUnique()
Returns whether objects are constrained to appear at most once in the list.
|
int |
lastIndexOf(java.lang.Object object)
Returns the position of the last occurrence of the object in the list.
|
protected E |
resolve(E object)
Returns the resolved object from this list for the purpose of testing whether
DelegatingNotifyingListImpl.removeAll(Collection) applies to it. |
protected E |
resolve(int index,
E 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.
|
<T> T[] |
toArray(T[] array)
Returns an array containing all the objects in sequence.
|
void |
unset()
Unsets the value held by the feature of the object.
|
protected E |
validate(int index,
E object)
Validates a new content object and returns the validated object.
|
basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArray
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
containsAll, delegateAdd, delegateAdd, delegateBasicList, delegateClear, delegateContains, delegateContainsAll, delegateEquals, delegateGet, delegateHashCode, delegateIndexOf, delegateIsEmpty, delegateIterator, delegateLastIndexOf, delegateList, delegateListIterator, delegateMove, delegateRemove, delegateSet, delegateSize, delegateToArray, delegateToArray, delegateToString, doClear, equals, get, hashCode, isEmpty, primitiveGet, remove, retainAll, size, toString
add, add, addAll, addAll, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, getDuplicates, getNonDuplicates, iterator, listIterator, listIterator, move, set, useEquals
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAllUnique, addAllUnique, addUnique, addUnique, basicAdd, basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicRemove, basicToArray, basicToArray, setUnique
protected final InternalEObject owner
public DelegatingEcoreEList(InternalEObject owner)
protected boolean canContainNull()
DelegatingNotifyingListImpl
!DelegatingNotifyingListImpl.hasInverse()
.canContainNull
in class DelegatingNotifyingListImpl<E>
!hasInverse
.protected boolean isUnique()
AbstractEList
false
, but clients can override this to ensure uniqueness of contents.
The performance impact is significant: operations such as add
are O(n) as a result requiring uniqueness.isUnique
in class AbstractEList<E>
protected boolean hasInverse()
DelegatingNotifyingListImpl
false
.hasInverse
in class DelegatingNotifyingListImpl<E>
false
.protected E validate(int index, E object)
AbstractEList
necessary
and returns the argument object.
Clients may throw additional types of runtime exceptions
in order to handle constraint violations.validate
in class AbstractEList<E>
index
- the position of the new content.object
- the new content.protected boolean isInstance(java.lang.Object object)
public java.lang.Object getNotifier()
DelegatingNotifyingListImpl
null
.getNotifier
in interface NotifyingList<E>
getNotifier
in class DelegatingNotifyingListImpl<E>
null
.public java.lang.Object getFeature()
DelegatingNotifyingListImpl
null
.getFeature
in interface NotifyingList<E>
getFeature
in class DelegatingNotifyingListImpl<E>
null
.Notification.getFeature()
public int getFeatureID()
DelegatingNotifyingListImpl
Notification.NO_FEATURE_ID
.getFeatureID
in interface NotifyingList<E>
getFeatureID
in class DelegatingNotifyingListImpl<E>
Notification.NO_FEATURE_ID
.Notification.getFeatureID(java.lang.Class<?>)
public EStructuralFeature getEStructuralFeature()
EStructuralFeature.Setting
getEStructuralFeature
in interface EStructuralFeature.Setting
protected EClassifier getFeatureType()
protected EReference getInverseEReference()
protected int getInverseFeatureID()
protected java.lang.Class<?> getInverseFeatureClass()
protected boolean hasManyInverse()
protected boolean hasNavigableInverse()
protected boolean isEObject()
protected boolean isContainment()
protected boolean hasProxies()
protected boolean hasInstanceClass()
protected E resolve(int index, E object)
AbstractEList
object
;
clients can use this to transform objects as they are fetched.resolve
in class AbstractEList<E>
index
- the position of the content.object
- the content.protected E resolve(E object)
DelegatingNotifyingListImpl
DelegatingNotifyingListImpl.removeAll(Collection)
applies to it.resolve
in class DelegatingNotifyingListImpl<E>
object
- the object to be resolved.public java.lang.Object[] toArray()
DelegatingEList
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
toArray
in class DelegatingEList<E>
public <T> T[] toArray(T[] array)
DelegatingEList
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
toArray
in class DelegatingEList<E>
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.protected NotificationImpl createNotification(int eventType, java.lang.Object oldObject, java.lang.Object newObject, int index, boolean wasSet)
DelegatingNotifyingListImpl
createNotification
in class DelegatingNotifyingListImpl<E>
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.protected NotificationImpl createNotification(int eventType, boolean oldValue, boolean newValue)
protected void dispatchNotification(Notification notification)
DelegatingNotifyingListImpl
dispatchNotification
in class DelegatingNotifyingListImpl<E>
notification
- the notification to dispatch.protected boolean isNotificationRequired()
DelegatingNotifyingListImpl
false
.isNotificationRequired
in class DelegatingNotifyingListImpl<E>
false
.public NotificationChain inverseAdd(E object, NotificationChain notifications)
DelegatingNotifyingListImpl
notifications
.
Clients can override this to update the inverse of a bidirectional relation.inverseAdd
in class DelegatingNotifyingListImpl<E>
object
- the object that's been added to the list.notifications
- the chain of accumulating notifications.notifications
.public NotificationChain inverseRemove(E object, NotificationChain notifications)
DelegatingNotifyingListImpl
notifications
.
Clients can override this to update the inverse of a bidirectional relation.inverseRemove
in class DelegatingNotifyingListImpl<E>
object
- the object that's been remove from the list.notifications
- the chain of accumulating notifications.notifications
.public boolean contains(java.lang.Object object)
contains
in interface java.util.Collection<E>
contains
in interface java.util.List<E>
contains
in class DelegatingEList<E>
object
- the object in question.public int indexOf(java.lang.Object object)
DelegatingEList
indexOf
in interface java.util.List<E>
indexOf
in class DelegatingEList<E>
object
- the object in question.public int lastIndexOf(java.lang.Object object)
DelegatingEList
lastIndexOf
in interface java.util.List<E>
lastIndexOf
in class DelegatingEList<E>
object
- the object in question.public EObject getEObject()
EStructuralFeature.Setting
getEObject
in interface EStructuralFeature.Setting
public java.lang.Object get(boolean resolve)
EStructuralFeature.Setting
resolves
the value.get
in interface EStructuralFeature.Setting
resolve
- whether to resolve.EObject.eGet(EStructuralFeature, boolean)
public void set(java.lang.Object newValue)
EStructuralFeature.Setting
set
in interface EStructuralFeature.Setting
newValue
- the newValue.EObject.eSet(EStructuralFeature, Object)
public boolean isSet()
DelegatingNotifyingListImpl
isSet
in interface EStructuralFeature.Setting
isSet
in interface InternalEList.Unsettable<E>
isSet
in class DelegatingNotifyingListImpl<E>
EObject.eIsSet(org.eclipse.emf.ecore.EStructuralFeature)
public void unset()
InternalEList.Unsettable
unset
in interface EStructuralFeature.Setting
unset
in interface InternalEList.Unsettable<E>
EObject.eUnset(org.eclipse.emf.ecore.EStructuralFeature)