org.eclipse.emf.common.util
Class DelegatingEList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byorg.eclipse.emf.common.util.DelegatingEList
All Implemented Interfaces:
Cloneable, Collection, EList, List, Serializable
Direct Known Subclasses:
DelegatingEList.UnmodifiableEList, DelegatingNotifyingListImpl

public abstract class DelegatingEList
extends AbstractList
implements EList, Cloneable, Serializable

A highly extensible delegating list implementation.

See Also:
Serialized Form

Nested Class Summary
protected  class DelegatingEList.EIterator
          An extensible iterator implementation.
protected  class DelegatingEList.EListIterator
          An extensible list iterator implementation.
protected  class DelegatingEList.NonResolvingEIterator
          An extended read-only iterator that does not resolve objects.
protected  class DelegatingEList.NonResolvingEListIterator
          An extended read-only list iterator that does not resolve objects.
static class DelegatingEList.UnmodifiableEList
          An unmodifiable version of DelegatingEList.
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DelegatingEList()
          Creates an empty instance.
DelegatingEList(Collection collection)
          Creates an instance that is a copy of the collection.
 
Method Summary
 void add(int index, Object object)
          Adds the object at the given index in the list.
 boolean add(Object object)
          Adds the object at the end of the list and returns whether the object was added; if uniqueness is required, duplicates will be ignored and false will be returned.
 boolean addAll(Collection collection)
          Adds each object of the collection to the end of the list.
 boolean addAll(int index, Collection collection)
          Adds each object of the collection at each successive index in the list and returns whether any objects were added.
 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 at the index of list and returns whether any objects were added; it does no ranging checking or 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.
protected  Object basicGet(int index)
          Returns the object at the index without resolving it.
protected  Iterator basicIterator()
          Returns a read-only iterator that does not resolve objects.
protected  List basicList()
          Returns an unsafe list that provides a non-resolving view of the backing store list.
protected  ListIterator basicListIterator()
          Returns a read-only list iterator that does not resolve objects.
protected  ListIterator basicListIterator(int index)
          Returns a read-only list iterator advanced to the given index that does not resolve objects.
protected  boolean canContainNull()
          Returns whether null is a valid object for the list.
 void clear()
          Clears the list of all objects.
 boolean contains(Object object)
          Returns whether the list contains the object.
 boolean containsAll(Collection collection)
          Returns whether the list contains each object in the collection.
protected  void delegateAdd(int index, Object object)
          Adds the object at the given index in the backing store list.
protected  void delegateAdd(Object object)
          Adds the object at the end of the backing store list.
protected  List delegateBasicList()
          Returns an unsafe list that provides a non-resolving view of the backing store list.
protected  void delegateClear()
          Clears the backing store list of all objects.
protected  boolean delegateContains(Object object)
          Returns whether the backing store list contains the object.
protected  boolean delegateContainsAll(Collection collection)
          Returns whether the backing store list contains each object in the collection.
protected  boolean delegateEquals(Object object)
          Returns whether the object is a list with corresponding equal objects to those in the backing store list.
protected  Object delegateGet(int index)
          Returns the object at the index in the backing store list.
protected  int delegateHashCode()
          Returns the hash code of the backing store list.
protected  int delegateIndexOf(Object object)
          Returns the position of the first occurrence of the object in the backing store list.
protected  boolean delegateIsEmpty()
          Returns whether the backing store list has zero size.
protected  Iterator delegateIterator()
          Returns an iterator over the backing store list.
protected  int delegateLastIndexOf(Object object)
          Returns the position of the last occurrence of the object in the backing store list.
protected abstract  List delegateList()
          Returns the list that acts as the backing store.
protected  ListIterator delegateListIterator()
          Returns a list iterator over the backing store list.
protected  Object delegateRemove(int index)
          Removes the object at the index from the backing store list and returns it.
protected  Object delegateSet(int index, Object object)
          Sets the object at the index in the backing store list and returns the old object at the index.
protected  int delegateSize()
          Returns the number of objects in the backing store list.
protected  Object[] delegateToArray()
          Returns an array containing all the objects in the backing store list in sequence.
protected  Object[] delegateToArray(Object[] array)
          Returns an array containing all the objects in the backing store list in sequence.
protected  String delegateToString()
          Returns a the string form of the backing store list.
protected  void didAdd(int index, Object newObject)
          Called to indicate that an object has been added to the backing store list.
protected  void didChange()
          Called to indicate that the backing store list has been changed.
protected  void didClear(int size, Object[] oldObjects)
          Called to indicate that the backing store list has been cleared.
protected  void didMove(int index, Object movedObject, int oldIndex)
          Called to indicate that an object has been moved in the backing store list.
protected  void didRemove(int index, Object oldObject)
          Called to indicate that an object has been removed from the backing store list.
protected  void didSet(int index, Object newObject, Object oldObject)
          Called to indicate that the backing store list has been set.
protected  void doClear(int oldSize, Object[] oldData)
          Does the actual job of clearing all the objects.
protected  boolean equalObjects(Object firstObject, Object secondObject)
          Returns whether two objects are equal using the appropriate comparison mechanism.
 boolean equals(Object object)
          Returns whether the object is a list with corresponding equal objects.
 Object get(int index)
          Returns the object at the index.
protected  Collection getDuplicates(Collection collection)
          Returns the collection of objects in the given collection that are also contained by this list.
protected  Collection getNonDuplicates(Collection collection)
          Returns the collection of objects in the given collection that are not also contained by this list.
 int hashCode()
          Returns a hash code computed from each object's hash code.
 int indexOf(Object object)
          Returns the position of the first occurrence of the object in the list.
 boolean isEmpty()
          Returns whether the list has zero size.
protected  boolean isUnique()
          Returns whether objects are constrained to appear at most once in the list.
 Iterator iterator()
          Returns an iterator.
 int lastIndexOf(Object object)
          Returns the position of the last occurrence of the object in the list.
 ListIterator listIterator()
          Returns a list iterator.
 ListIterator listIterator(int index)
          Returns a list iterator advanced to the given index.
 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.
 void move(int index, Object object)
          Moves the object to the index of the list.
 Object remove(int index)
          Removes the object at the index from the list and returns it.
 boolean remove(Object object)
          Removes the object from the list and returns whether the object was actually contained by the list.
 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(int index, Object object)
          Resolves the object at the index and returns the result.
 boolean retainAll(Collection collection)
          Removes from the list each object not contained by the collection and returns whether any object was actually removed.
 Object set(int index, Object object)
          Sets the object at the index and returns the old object at the index.
 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.
 int size()
          Returns the number of objects in the list.
 Object[] toArray()
          Returns an array containing all the objects in sequence.
 Object[] toArray(Object[] array)
          Returns an array containing all the objects in sequence.
 String toString()
          Returns a string of the form "[object1, object2]".
protected  boolean useEquals()
          Returns whether equals rather than == should be used to compare members.
protected  Object validate(int index, Object object)
          Validates a new content object and returns the validated object.
 
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 java.util.List
subList
 

Constructor Detail

DelegatingEList

public DelegatingEList()
Creates an empty instance.


DelegatingEList

public DelegatingEList(Collection collection)
Creates an instance that is a copy of the collection.

Parameters:
collection - the initial contents of the list.
Method Detail

useEquals

protected boolean useEquals()
Returns whether equals rather than == should be used to compare members. The default is to return true but clients can optimize performance by returning false. The performance difference is highly significant.

Returns:
whether equals rather than == should be used.

equalObjects

protected boolean equalObjects(Object firstObject,
                               Object secondObject)
Returns whether two objects are equal using the appropriate comparison mechanism.

Returns:
whether two objects are equal.

canContainNull

protected boolean canContainNull()
Returns whether null is a valid object for the list. The default is to return true, but clients can override this to exclude null.

Returns:
whether null is a valid object for the list.

isUnique

protected boolean isUnique()
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.

Returns:
whether objects are constrained to appear at most once in the list.

validate

protected Object validate(int index,
                          Object object)
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.

Parameters:
index - the position of the new content.
object - the new content.
Returns:
the validated content.
Throws:
IllegalArgumentException - if a constraint prevents the object from being added.

resolve

protected Object resolve(int index,
                         Object object)
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.

Parameters:
index - the position of the content.
object - the content.
Returns:
the resolved object.

didSet

protected void didSet(int index,
                      Object newObject,
                      Object oldObject)
Called to indicate that the backing store list has been set. This implementation does nothing; clients can use this to monitor settings to the backing store list.

Parameters:
index - the position that was set.
newObject - the new object at the position.
oldObject - the old object at the position.

didAdd

protected void didAdd(int index,
                      Object newObject)
Called to indicate that an object has been added to the backing store list. This implementation does nothing; clients can use this to monitor additions to the backing store list.

Parameters:
index - the position object the new object.
newObject - the new object at the position.

didRemove

protected void didRemove(int index,
                         Object oldObject)
Called to indicate that an object has been removed from the backing store list. This implementation does nothing; clients can use this to monitor removals from the backing store list.

Parameters:
index - the position of the old object.
oldObject - the old object at the position.

didClear

protected void didClear(int size,
                        Object[] oldObjects)
Called to indicate that the backing store list has been cleared. This implementation calls didRemove for each object; clients can use this to monitor clearing of the backing store list.

Parameters:
size - the original size of the list.
oldObjects - the old backing store list being discarded.
See Also:
didRemove(int, java.lang.Object)

didMove

protected void didMove(int index,
                       Object movedObject,
                       int oldIndex)
Called to indicate that an object has been moved in the backing store list. This implementation does nothing; clients can use this to monitor movement in the backing store list.

Parameters:
index - the position of the moved object.
movedObject - the moved object at the position.
oldIndex - the position the object was at before the move.

didChange

protected void didChange()
Called to indicate that the backing store list has been changed. This implementation does nothing; clients can use this to monitor change in the backing store list.


delegateList

protected abstract List delegateList()
Returns the list that acts as the backing store.

Returns:
the list that acts as the backing store.

size

public int size()
Returns the number of objects in the list.

Specified by:
size in interface List
Returns:
the number of objects in the list.

delegateSize

protected int delegateSize()
Returns the number of objects in the backing store list.

Returns:
the number of objects in the backing store list.

isEmpty

public boolean isEmpty()
Returns whether the list has zero size.

Specified by:
isEmpty in interface List
Returns:
whether the list has zero size.

delegateIsEmpty

protected boolean delegateIsEmpty()
Returns whether the backing store list has zero size.

Returns:
whether the backing store list has zero size.

contains

public boolean contains(Object object)
Returns whether the list contains the object.

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

delegateContains

protected boolean delegateContains(Object object)
Returns whether the backing store list contains the object.

Parameters:
object - the object in question.
Returns:
whether the backing store list contains the object.

containsAll

public boolean containsAll(Collection collection)
Returns whether the list contains each object in the collection.

Specified by:
containsAll in interface List
Returns:
whether the list contains each object in the collection.
See Also:
contains(java.lang.Object), useEquals()

delegateContainsAll

protected boolean delegateContainsAll(Collection collection)
Returns whether the backing store list contains each object in the collection.

Returns:
whether the backing store list contains each object in the collection.
See Also:
contains(java.lang.Object), useEquals()

indexOf

public int indexOf(Object object)
Returns the position of the first occurrence of the object in the list.

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

delegateIndexOf

protected int delegateIndexOf(Object object)
Returns the position of the first occurrence of the object in the backing store list.

Parameters:
object - the object in question.
Returns:
the position of the first occurrence of the object in the backing store list.

lastIndexOf

public int lastIndexOf(Object object)
Returns the position of the last occurrence of the object in the list.

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

delegateLastIndexOf

protected int delegateLastIndexOf(Object object)
Returns the position of the last occurrence of the object in the backing store list.

Parameters:
object - the object in question.
Returns:
the position of the last occurrence of the object in the backing store list.

toArray

public Object[] toArray()
Returns an array containing all the objects in sequence.

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

delegateToArray

protected Object[] delegateToArray()
Returns an array containing all the objects in the backing store list in sequence.

Returns:
an array containing all the objects in the backing store list in sequence.

toArray

public Object[] toArray(Object[] array)
Returns an array containing all the objects in sequence.

Specified by:
toArray in interface List
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.

delegateToArray

protected Object[] delegateToArray(Object[] array)
Returns an array containing all the objects in the backing store list in sequence.

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.

get

public Object get(int index)
Returns the object at the index. This implementation delegates to resolve so that clients may transform the fetched object.

Specified by:
get in interface List
Parameters:
index - the position in question.
Returns:
the object at the index.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.
See Also:
resolve(int, java.lang.Object), basicGet(int)

delegateGet

protected Object delegateGet(int index)
Returns the object at the index in the backing store list.

Parameters:
index - the position in question.
Returns:
the object at the index.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.

basicGet

protected Object basicGet(int index)
Returns the object at the index without resolving it.

Parameters:
index - the position in question.
Returns:
the object at the index.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.
See Also:
resolve(int, java.lang.Object), get(int)

set

public Object set(int index,
                  Object object)
Sets the object at the index and returns the old object at the index. This implementation delegates to setUnique after range checking and after uniqueness checking.

Specified by:
set in interface List
Parameters:
index - the position in question.
object - the object to set.
Returns:
the old object at the index.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.
IllegalArgumentException - if there is a constraint violation, e.g., non-uniqueness.
See Also:
setUnique(int, java.lang.Object)

setUnique

public 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. This implementation delegates to didSet and didChange.

Parameters:
index - the position in question.
object - the object to set.
Returns:
the old object at the index.
See Also:
set(int, java.lang.Object)

delegateSet

protected Object delegateSet(int index,
                             Object object)
Sets the object at the index in the backing store list and returns the old object at the index.

Parameters:
object - the object to set.
Returns:
the old object at the index.

add

public boolean add(Object object)
Adds the object at the end of the list and returns whether the object was added; if uniqueness is required, duplicates will be ignored and false will be returned. This implementation delegates to addUnique(Object) after uniqueness checking.

Specified by:
add in interface List
Parameters:
object - the object to be added.
Returns:
whether the object was added.
See Also:
addUnique(Object)

addUnique

public void addUnique(Object object)
Adds the object at the end of the list; it does no uniqueness checking. This implementation delegates to didAdd and didChange. after uniqueness checking.

Parameters:
object - the object to be added.
See Also:
add(Object)

delegateAdd

protected void delegateAdd(Object object)
Adds the object at the end of the backing store list.

Parameters:
object - the object to be added.

add

public void add(int index,
                Object object)
Adds the object at the given index in the list. If uniqueness is required, duplicates will be ignored. This implementation delegates to addUnique(int, Object) after uniqueness checking.

Specified by:
add in interface List
Parameters:
object - the object to be added.
Throws:
IllegalArgumentException - if uniqueness is required, and the object is a duplicate.
See Also:
addUnique(int, Object)

addUnique

public void addUnique(int index,
                      Object object)
Adds the object at the given index in the list; it does no ranging checking or uniqueness checking. This implementation delegates to didAdd and didChange.

Parameters:
object - the object to be added.
See Also:
add(int, Object)

delegateAdd

protected void delegateAdd(int index,
                           Object object)
Adds the object at the given index in the backing store list.

Parameters:
object - the object to be added.

addAll

public boolean addAll(Collection collection)
Adds each object of the collection to the end of the list. If uniqueness is required, duplicates will be removed from the collection, which could even result in an empty collection. This implementation delegates to addAllUnique(Collection) after uniqueness checking.

Specified by:
addAll in interface List
Parameters:
collection - the collection of objects to be added.
See Also:
addAllUnique(Collection)

addAllUnique

public boolean addAllUnique(Collection collection)
Adds each object of the collection to the end of the list; it does no uniqueness checking. This implementation delegates to didAdd and didChange.

Parameters:
collection - the collection of objects to be added.
See Also:
addAll(Collection)

addAll

public boolean addAll(int index,
                      Collection collection)
Adds each object of the collection at each successive index in the list and returns whether any objects were added. If uniqueness is required, duplicates will be removed from the collection, which could even result in an empty collection. This implementation delegates to addAllUnique(int, Collection) after uniqueness checking.

Specified by:
addAll in interface List
Parameters:
index - the index at which to add.
collection - the collection of objects to be added.
Returns:
whether any objects were added.
See Also:
addAllUnique(int, Collection)

addAllUnique

public 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. This implementation delegates to didAdd and didChange.

Parameters:
index - the index at which to add.
collection - the collection of objects to be added.
Returns:
whether any objects were added.
See Also:
addAll(int, Collection)

addAllUnique

public boolean addAllUnique(Object[] objects,
                            int start,
                            int end)
Adds each object from start to end of the array at the index of list and returns whether any objects were added; it does no ranging checking or uniqueness checking. This implementation delegates to assign, didAdd, and didChange.

Parameters:
objects - the objects to be added.
start - the index of first object to be added.
end - the index past teh last object to be added.
Returns:
whether any objects were added.
See Also:
addAllUnique(int, Object[], int, int)

addAllUnique

public 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. This implementation delegates to assign, didAdd, and didChange.

Parameters:
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.
Returns:
whether any objects were added.
See Also:
addAllUnique(Object[], int, int)

remove

public boolean remove(Object object)
Removes the object from the list and returns whether the object was actually contained by the list. This implementation uses indexOf to find the object and delegates to remove(int) in the case that it finds the object.

Specified by:
remove in interface List
Parameters:
object - the object to be removed.
Returns:
whether the object was actually contained by the list.

removeAll

public boolean removeAll(Collection collection)
Removes each object of the collection from the list and returns whether any object was actually contained by the list.

Specified by:
removeAll in interface List
Parameters:
collection - the collection of objects to be removed.
Returns:
whether any object was actually contained by the list.

remove

public Object remove(int index)
Removes the object at the index from the list and returns it. This implementation delegates to didRemove and didChange.

Specified by:
remove in interface List
Parameters:
index - the position of the object to remove.
Returns:
the removed object.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.

delegateRemove

protected Object delegateRemove(int index)
Removes the object at the index from the backing store list and returns it.

Returns:
the removed object.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.

retainAll

public boolean retainAll(Collection collection)
Removes from the list each object not contained by the collection and returns whether any object was actually removed. This delegates to remove(int) in the case that it finds an object that isn't retained.

Specified by:
retainAll in interface List
Parameters:
collection - the collection of objects to be retained.
Returns:
whether any object was actually removed.

clear

public void clear()
Clears the list of all objects.

Specified by:
clear in interface List

doClear

protected void doClear(int oldSize,
                       Object[] oldData)
Does the actual job of clearing all the objects.

Parameters:
oldSize - the size of the list before it is cleared.
oldData - old values of the list before it is cleared.

delegateClear

protected void delegateClear()
Clears the backing store list of all objects.


move

public void move(int index,
                 Object object)
Moves the object to the index of the list. This implementation uses indexOf(java.lang.Object) of find the object and delegates to move(int, int).

Specified by:
move in interface EList
Parameters:
index - the new position for the object in the list.
object - the object to be moved.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range or the object isn't contained by the list.

move

public 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. This implementation delegates to didMove and didChange.

Specified by:
move in interface EList
Parameters:
targetIndex - the new position for the object in the list.
sourceIndex - the old position of the object in the list.
Returns:
the moved object.
Throws:
IndexOutOfBoundsException - if either index isn't within the size range.

equals

public boolean equals(Object object)
Returns whether the object is a list with corresponding equal objects. This implementation uses either equals or "==" depending on useEquals.

Specified by:
equals in interface List
Returns:
whether the object is a list with corresponding equal objects.
See Also:
useEquals()

delegateEquals

protected boolean delegateEquals(Object object)
Returns whether the object is a list with corresponding equal objects to those in the backing store list.

Returns:
whether the object is a list with corresponding equal objects.

hashCode

public int hashCode()
Returns a hash code computed from each object's hash code.

Specified by:
hashCode in interface List
Returns:
a hash code.

delegateHashCode

protected int delegateHashCode()
Returns the hash code of the backing store list.

Returns:
a hash code.

toString

public String toString()
Returns a string of the form "[object1, object2]".

Returns:
a string of the form "[object1, object2]".

delegateToString

protected String delegateToString()
Returns a the string form of the backing store list.

Returns:
a the string form of the backing store list.

iterator

public Iterator iterator()
Returns an iterator. This implementation allocates a DelegatingEList.EIterator.

Specified by:
iterator in interface List
Returns:
an iterator.
See Also:
DelegatingEList.EIterator

delegateIterator

protected Iterator delegateIterator()
Returns an iterator over the backing store list.

Returns:
an iterator.

basicIterator

protected Iterator basicIterator()
Returns a read-only iterator that does not resolve objects. This implementation allocates a DelegatingEList.NonResolvingEIterator.

Returns:
a read-only iterator that does not resolve objects.

listIterator

public ListIterator listIterator()
Returns a list iterator. This implementation allocates a DelegatingEList.EListIterator.

Specified by:
listIterator in interface List
Returns:
a list iterator.
See Also:
DelegatingEList.EListIterator

delegateListIterator

protected ListIterator delegateListIterator()
Returns a list iterator over the backing store list.

Returns:
a list iterator.

listIterator

public ListIterator listIterator(int index)
Returns a list iterator advanced to the given index. This implementation allocates a DelegatingEList.EListIterator.

Specified by:
listIterator in interface List
Parameters:
index - the starting index.
Returns:
a list iterator advanced to the index.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.
See Also:
DelegatingEList.EListIterator

basicListIterator

protected ListIterator basicListIterator()
Returns a read-only list iterator that does not resolve objects. This implementation allocates a DelegatingEList.NonResolvingEListIterator.

Returns:
a read-only list iterator that does not resolve objects.

basicListIterator

protected ListIterator basicListIterator(int index)
Returns a read-only list iterator advanced to the given index that does not resolve objects. This implementation allocates a DelegatingEList.NonResolvingEListIterator.

Parameters:
index - the starting index.
Returns:
a read-only list iterator advanced to the index.
Throws:
IndexOutOfBoundsException - if the index isn't within the size range.

basicList

protected List basicList()
Returns an unsafe list that provides a non-resolving view of the backing store list.

Returns:
an unsafe list that provides a non-resolving view of the backign store list.

delegateBasicList

protected List delegateBasicList()
Returns an unsafe list that provides a non-resolving view of the backing store list.

Returns:
an unsafe list that provides a non-resolving view of the backing store list.

getDuplicates

protected Collection getDuplicates(Collection collection)
Returns the collection of objects in the given collection that are also contained by this list.

Parameters:
collection - the other collection.
Returns:
the collection of objects in the given collection that are also contained by this list.

getNonDuplicates

protected Collection getNonDuplicates(Collection collection)
Returns the collection of objects in the given collection that are not also contained by this list.

Parameters:
collection - the other collection.
Returns:
the collection of objects in the given collection that are not also contained by this list.

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