|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
org.eclipse.emf.common.util.BasicEList
org.eclipse.emf.common.notify.impl.NotifyingListImpl
An extensible implementation of a notifying list.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.emf.common.util.BasicEList |
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator, BasicEList.EListIterator, BasicEList.FastCompare, BasicEList.NonResolvingEIterator, BasicEList.NonResolvingEListIterator, BasicEList.UnmodifiableEList |
| Field Summary |
| Fields inherited from class org.eclipse.emf.common.util.BasicEList |
data, size |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
NotifyingListImpl()
Creates an empty instance. |
|
NotifyingListImpl(Collection collection)
Creates an instance that is a copy of the collection. |
|
NotifyingListImpl(int initialCapacity)
Creates an empty instance with the given capacity. |
|
| Method Summary | |
boolean |
addAllUnique(Collection collection)
Adds each object of the collection to the end of the list; it does no uniqueness checking. |
boolean |
addAllUnique(int index,
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. |
boolean |
addAllUnique(int index,
Object[] objects,
int start,
int end)
Adds each object from start to end of the array at each successive index in the list and returns whether any objects were added; it does no ranging checking or uniqueness checking. |
boolean |
addAllUnique(Object[] objects,
int start,
int end)
Adds each object from start to end of the array to the end of the list and returns whether any objects were added; it does no uniqueness checking. |
void |
addUnique(int index,
Object object)
Adds the object at the given index in the list; it does no ranging checking or uniqueness checking. |
void |
addUnique(Object object)
Adds the object at the end of the list; it does no uniqueness checking. |
NotificationChain |
basicAdd(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(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,
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,
Object oldObject,
Object newObject,
int index)
|
protected NotificationImpl |
createNotification(int eventType,
Object oldObject,
Object newObject,
int index,
boolean wasSet)
Creates a notification. |
protected NotificationChain |
createNotificationChain(int capacity)
Creates a notification chain, if the expected capacity exceeds the threshold at which a list is better than chaining individual notification instances. |
protected void |
dispatchNotification(Notification notification)
Dispatches a notification to the notifier of the list. |
protected boolean |
doAddAllUnique(Collection collection)
Adds each object of the collection to the end of the list; it does no uniqueness checking, inverse updating, or notification. |
protected boolean |
doAddAllUnique(int index,
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 range checking, uniqueness checking, inverse updating, or notification. |
protected boolean |
doAddAllUnique(int index,
Object[] objects,
int start,
int end)
Adds each object from start to end of the array at each successive index in the list and returns whether any objects were added; it does no ranging checking, uniqueness checking, inverse updating, or notification. |
protected boolean |
doAddAllUnique(Object[] objects,
int start,
int end)
Adds each object from start to end of the array to the end of the list and returns whether any objects were added; it does no ranging checking, uniqueness checking, inverse updating, or notification. |
protected void |
doAddUnique(int index,
Object object)
Adds the object at the given index in the list; it does no range checking, uniqueness checking, inverse updating, or notification. |
protected void |
doAddUnique(Object object)
Adds the object at the end of the list; it does no uniqueness checking, inverse updating, or notification. |
protected void |
doClear()
Clears the list of all objects; it does no inverse updating. |
protected Object |
doMove(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; it does no notification. |
protected Object |
doRemove(int index)
Removes the object at the index from the list and returns it; it does no inverse updating, or notification. |
protected boolean |
doRemoveAll(Collection collection)
Removes each object of the collection from the list and returns whether any object was actually contained by the list; it does no inverse updating, or notification. |
protected Object |
doSetUnique(int index,
Object object)
Sets the object at the index and returns the old object at the index; it does no ranging checking, uniqueness checking, inverse updating or notification. |
Object |
getFeature()
Returns null. |
int |
getFeatureID()
Returns Notification.NO_FEATURE_ID. |
protected int |
getFeatureID(Class expectedClass)
Returns the result of calling getFeatureID(). |
Object |
getNotifier()
Returns null. |
protected boolean |
hasInverse()
Returns false. |
protected boolean |
hasShadow()
Returns false. |
protected NotificationChain |
inverseAdd(Object object,
NotificationChain notifications)
Does nothing and returns the notifications.
|
protected NotificationChain |
inverseRemove(Object object,
NotificationChain notifications)
Does nothing and returns the notifications.
|
protected boolean |
isNotificationRequired()
Returns false. |
protected boolean |
isSet()
Returns whether the list is considered set, i.e., whether it's not empty. |
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. |
Object |
remove(int index)
Removes the object at the index from the list and returns it. |
boolean |
removeAll(Collection collection)
Removes each object of the collection from the list and returns whether any object was actually contained by the list. |
protected Object |
resolve(Object object)
Returns the resolved object from this list for the purpose of testing whether removeAll(Collection) applies to it. |
Object |
setUnique(int index,
Object object)
Sets the object at the index and returns the old object at the index; it does no ranging checking or uniqueness checking. |
protected NotificationChain |
shadowAdd(Object object,
NotificationChain notifications)
Does nothing and returns the notifications.
|
protected NotificationChain |
shadowRemove(Object object,
NotificationChain notifications)
Does nothing and returns the notifications.
|
protected NotificationChain |
shadowSet(Object oldObject,
Object newObject,
NotificationChain notifications)
Does nothing and returns the notifications.
|
| Methods inherited from class org.eclipse.emf.common.util.BasicEList |
add, add, addAll, addAll, assign, basicGet, basicIterator, basicList, basicListIterator, basicListIterator, clone, contains, containsAll, data, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, get, getDuplicates, getNonDuplicates, grow, hashCode, indexOf, isEmpty, isUnique, iterator, lastIndexOf, listIterator, listIterator, move, newData, remove, resolve, retainAll, set, setData, shrink, size, toArray, toArray, 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.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 NotifyingListImpl()
public NotifyingListImpl(int initialCapacity)
initialCapacity - the initial capacity of the list before it must grow.public NotifyingListImpl(Collection collection)
collection - the initial contents of the list.| Method Detail |
public Object getNotifier()
null.
getNotifier in interface NotifyingListnull.public Object getFeature()
null.
getFeature in interface NotifyingListnull.Notification.getFeature()public int getFeatureID()
Notification.NO_FEATURE_ID.
getFeatureID in interface NotifyingListNotification.NO_FEATURE_ID.Notification.getFeatureID(java.lang.Class)protected int getFeatureID(Class expectedClass)
getFeatureID().
expectedClass - the class to which the ID is relative.
getFeatureID().protected boolean isSet()
protected boolean hasInverse()
false.
false.protected boolean canContainNull()
!hasInverse().
canContainNull in class BasicEList!hasInverse.protected boolean isNotificationRequired()
false.
false.protected boolean hasShadow()
false.
false.
protected NotificationChain shadowAdd(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 shadowRemove(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 NotificationChain shadowSet(Object oldObject,
Object newObject,
NotificationChain notifications)
notifications.
Clients can override this to update the inverse of a bidirectional relation.
oldObject - the object that's been removed from the list.newObject - the object that's been added to the list.notifications - the chain of accumulating notifications.
notifications.
protected NotificationChain inverseAdd(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(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,
Object oldObject,
Object newObject,
int index)
protected NotificationImpl createNotification(int eventType,
Object oldObject,
Object newObject,
int index,
boolean wasSet)
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 NotificationChain createNotificationChain(int capacity)
protected void dispatchNotification(Notification notification)
notification - the notification to dispatch.public void addUnique(Object object)
required
and delegates to inverseAdd as required.
addUnique in class BasicEListobject - the object to be added.isNotificationRequired(),
hasInverse(),
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)protected void doAddUnique(Object object)
object - the object to be added.
public void addUnique(int index,
Object object)
required
and delegates to inverseAdd as required.
addUnique in class BasicEListobject - the object to be added.isNotificationRequired(),
hasInverse(),
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
protected void doAddUnique(int index,
Object object)
object - the object to be added.public boolean addAllUnique(Collection collection)
addAllUnique(int, Collection).
addAllUnique in class BasicEListcollection - the collection of objects to be added.inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)protected boolean doAddAllUnique(Collection collection)
collection - the collection of objects to be added.
public boolean addAllUnique(int index,
Collection collection)
required
and delegates to inverseAdd as required.
addAllUnique in class BasicEListindex - 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)
protected boolean doAddAllUnique(int index,
Collection collection)
index - the index at which to add.collection - the collection of objects to be added.
public boolean addAllUnique(Object[] objects,
int start,
int end)
addAllUnique(int, Object[], int, int).
addAllUnique in class BasicEListobjects - the objects to be added.start - the index of first object to be added.end - the index past the last object to be added.
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
protected boolean doAddAllUnique(Object[] objects,
int start,
int end)
objects - the objects to be added.start - the index of first object to be added.end - the index past the last object to be added.
public boolean addAllUnique(int index,
Object[] objects,
int start,
int end)
assign, didAdd, and didChange.
In addition to the normal effects,
this override implementation generates notifications as required
and delegates to inverseAdd as required.
addAllUnique in class BasicEListindex - the index at which to add.objects - the objects to be added.start - the index of first object to be added.end - the index past the last object to be added.
addAllUnique(int, Collection),
isNotificationRequired(),
hasInverse(),
inverseAdd(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)
protected boolean doAddAllUnique(int index,
Object[] objects,
int start,
int end)
index - the index at which to add.objects - the objects to be added.start - the index of first object to be added.end - the index past the last object to be added.
public NotificationChain basicAdd(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 Object remove(int index)
required
and delegates to inverseRemove as required.
remove in interface Listremove in class BasicEListindex - the position of the object to remove.
IndexOutOfBoundsException - if the index isn't within the size range.isNotificationRequired(),
hasInverse(),
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)protected Object doRemove(int index)
index - the position of the object to remove.
IndexOutOfBoundsException - if the index isn't within the size range.public boolean removeAll(Collection collection)
required
and delegates to inverseRemove as required.
removeAll in interface ListremoveAll in class BasicEListcollection - the collection of objects to be removed.
isNotificationRequired(),
hasInverse(),
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)protected Object resolve(Object object)
removeAll(Collection) applies to it.
object - the object to be resolved.
protected boolean doRemoveAll(Collection collection)
collection - the collection of objects to be removed.
public NotificationChain basicRemove(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 Listclear in class BasicEListisNotificationRequired(),
hasInverse(),
inverseRemove(java.lang.Object, org.eclipse.emf.common.notify.NotificationChain)protected void doClear()
inverse updating.
public Object setUnique(int index,
Object object)
required
and delegates to inverseAdd and inverseRemove as required.
setUnique in class BasicEListindex - 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)
protected Object doSetUnique(int index,
Object object)
index - the position in question.object - the object to set.
public NotificationChain basicSet(int index,
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 Object move(int targetIndex,
int sourceIndex)
required.
move in interface EListmove in class BasicEListtargetIndex - the new position for the object in the list.sourceIndex - the old position of the object in the list.
IndexOutOfBoundsException - if either index isn't within the size range.isNotificationRequired()
protected Object doMove(int targetIndex,
int sourceIndex)
targetIndex - the new position for the object in the list.sourceIndex - the old position of the object in the list.
IndexOutOfBoundsException - if either index isn't within the size range.
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||