|
||||||||||
PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractList | +--org.eclipse.emf.common.util.DelegatingEList | +--org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl
An extensible implementation of a notifying list that delegates to a backing list.
Inner classes inherited from class org.eclipse.emf.common.util.DelegatingEList |
---|
DelegatingEList.EIterator, DelegatingEList.EListIterator, DelegatingEList.NonResolvingEIterator, DelegatingEList.NonResolvingEListIterator, DelegatingEList.UnmodifiableEList |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
DelegatingNotifyingListImpl()
Creates an empty instance. |
|
DelegatingNotifyingListImpl(java.util.Collection collection)
Creates an instance that is a copy of the collection. |
Method Summary | |
---|---|
boolean |
addAllUnique(java.util.Collection collection)
Adds each object of the collection to the end of the list; it does no uniqueness checking. |
boolean |
addAllUnique(int index,
java.util.Collection collection)
Adds each object of the collection at each successive index in the list and returns whether any objects were added; it does no ranging checking or uniqueness checking. |
void |
addUnique(int index,
java.lang.Object object)
Adds the object at the given index in the list; it does no ranging checking or uniqueness checking. |
void |
addUnique(java.lang.Object object)
Adds the object at the end of the list; it does no uniqueness checking. |
NotificationChain |
basicAdd(java.lang.Object object,
NotificationChain notifications)
Adds the object at the end of the list and returns the potentially updated notification chain; it does no inverse updating. |
NotificationChain |
basicRemove(java.lang.Object object,
NotificationChain notifications)
Removes the object from the list and returns the potentially updated notification chain; it does no inverse updating. |
NotificationChain |
basicSet(int index,
java.lang.Object object,
NotificationChain notifications)
Sets the object at the index and returns the potentially updated notification chain; it does no inverse updating. |
protected boolean |
canContainNull()
Returns ! . |
void |
clear()
Clears the list of all objects. |
protected NotificationImpl |
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 |
getFeature()
Returns null . |
int |
getFeatureID()
Returns Notification.NO_FEATURE_ID . |
protected int |
getFeatureID(java.lang.Class expectedClass)
Returns the result of calling getFeatureID() . |
java.lang.Object |
getNotifier()
Returns null . |
protected boolean |
hasInverse()
Returns false . |
protected NotificationChain |
inverseAdd(java.lang.Object object,
NotificationChain notifications)
Does nothing and returns the notifications . |
protected NotificationChain |
inverseRemove(java.lang.Object object,
NotificationChain notifications)
Does nothing and returns the notifications . |
protected boolean |
isNotificationRequired()
Returns false . |
java.lang.Object |
move(int targetIndex,
int sourceIndex)
Moves the object at the source index of the list to the target index of the list and returns the moved object. |
java.lang.Object |
remove(int index)
Removes the object at the index from the list and returns it. |
boolean |
removeAll(java.util.Collection collection)
Removes each object of the collection from the list and returns whether any object was actually contained by the list. |
java.lang.Object |
setUnique(int index,
java.lang.Object object)
Sets the object at the index and returns the old object at the index; it does no ranging checking or uniqueness checking. |
Methods inherited from class org.eclipse.emf.common.util.DelegatingEList |
---|
add, add, addAll, addAll, basicGet, basicIterator, basicList, basicListIterator, basicListIterator, contains, 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, indexOf, isEmpty, isUnique, iterator, lastIndexOf, listIterator, listIterator, move, remove, resolve, retainAll, set, size, toArray, toArray, toString, useEquals, validate |
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.common.util.EList |
---|
move |
Methods inherited from interface java.util.List |
---|
add, add, addAll, addAll, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, retainAll, set, size, subList, toArray, toArray |
Constructor Detail |
public DelegatingNotifyingListImpl()
public DelegatingNotifyingListImpl(java.util.Collection collection)
collection
- the initial contents of the list.Method Detail |
public java.lang.Object getNotifier()
null
.getNotifier
in interface NotifyingList
null
.public java.lang.Object getFeature()
null
.getFeature
in interface NotifyingList
null
.public int getFeatureID()
Notification.NO_FEATURE_ID
.getFeatureID
in interface NotifyingList
Notification.NO_FEATURE_ID
.protected int getFeatureID(java.lang.Class expectedClass)
getFeatureID()
.expectedClass
- the class to which the ID is relative.getFeatureID()
.protected boolean hasInverse()
false
.false
.protected boolean canContainNull()
!hasInverse()
.canContainNull
in class DelegatingEList
!hasInverse
.protected boolean isNotificationRequired()
false
.false
.protected NotificationChain inverseAdd(java.lang.Object object, NotificationChain notifications)
notifications
.
Clients can override this to update the inverse of a bidirectional relation.object
- the object that's been added to the list.notifications
- the chain of accumulating notifications.notifications
.protected NotificationChain inverseRemove(java.lang.Object object, NotificationChain notifications)
notifications
.
Clients can override this to update the inverse of a bidirectional relation.object
- the object that's been remove from the list.notifications
- the chain of accumulating notifications.notifications
.protected NotificationImpl createNotification(int eventType, java.lang.Object oldObject, java.lang.Object newObject, int index)
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.protected void dispatchNotification(Notification notification)
notification
- the notification to dispatch.public void addUnique(java.lang.Object object)
required
and delegates to inverseAdd
as required
.addUnique
in class DelegatingEList
object
- the object to be added.isNotificationRequired()
,
hasInverse()
,
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public void addUnique(int index, java.lang.Object object)
required
and delegates to inverseAdd
as required
.addUnique
in class DelegatingEList
object
- the object to be added.isNotificationRequired()
,
hasInverse()
,
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public boolean addAllUnique(java.util.Collection collection)
addAllUnique(int, Collection)
.addAllUnique
in class DelegatingEList
collection
- the collection of objects to be added.inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public boolean addAllUnique(int index, java.util.Collection collection)
required
and delegates to inverseAdd
as required
.addAllUnique
in class DelegatingEList
index
- the index at which to add.collection
- the collection of objects to be added.isNotificationRequired()
,
hasInverse()
,
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public NotificationChain basicAdd(java.lang.Object object, NotificationChain notifications)
inverse
updating.
This implementation generates notifications as required
.object
- the object to be added.isNotificationRequired()
,
hasInverse()
,
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public java.lang.Object remove(int index)
required
and delegates to inverseRemove
as required
.remove
in interface java.util.List
remove
in class DelegatingEList
index
- the position of the object to remove.java.lang.IndexOutOfBoundsException
- if the index isn't within the size range.isNotificationRequired()
,
hasInverse()
,
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public boolean removeAll(java.util.Collection collection)
required
and delegates to inverseRemove
as required
.removeAll
in interface java.util.List
removeAll
in class DelegatingEList
collection
- the collection of objects to be removed.isNotificationRequired()
,
hasInverse()
,
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public NotificationChain basicRemove(java.lang.Object object, NotificationChain notifications)
inverse
updating.
This implementation generates notifications as required
.object
- the object to be removed.isNotificationRequired()
,
hasInverse()
,
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public void clear()
required
and delegates to inverseRemove
as required
.clear
in interface java.util.List
clear
in class DelegatingEList
isNotificationRequired()
,
hasInverse()
,
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public java.lang.Object setUnique(int index, java.lang.Object object)
required
and delegates to inverseAdd
and inverseRemove
as required
.setUnique
in class DelegatingEList
index
- the position in question.object
- the object to set.isNotificationRequired()
,
hasInverse()
,
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
,
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public NotificationChain basicSet(int index, java.lang.Object object, NotificationChain notifications)
inverse
updating.
This implementation generates notifications as required
.index
- the position in question.object
- the object to set.isNotificationRequired()
,
hasInverse()
,
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
,
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
public java.lang.Object move(int targetIndex, int sourceIndex)
required
.move
in interface EList
move
in class DelegatingEList
targetIndex
- the new position for the object in the list.sourceIndex
- the old position of the object in the list.java.lang.IndexOutOfBoundsException
- if either index isn't within the size range.isNotificationRequired()
|
Copyright 2001-2003 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |