Eclipse Platform
Release 3.6

org.eclipse.core.databinding.observable.list
Interface IObservableList

All Superinterfaces:
java.util.Collection, IObservable, IObservableCollection, java.lang.Iterable, java.util.List
All Known Subinterfaces:
ISWTObservableList, IViewerObservableList
All Known Implementing Classes:
AbstractObservableList, ComputedList, DecoratingObservableList, MultiList, ObservableList, WritableList

public interface IObservableList
extends java.util.List, IObservableCollection

A list whose changes can be tracked by list change listeners.

Since:
1.0
See Also:
AbstractObservableList, ObservableList
Restriction:
This interface is not intended to be implemented by clients. Clients should instead subclass one of the framework classes that implement this interface. Note that direct implementers of this interface outside of the framework will be broken in future releases when methods are added to this interface.

Method Summary
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 void addListChangeListener(IListChangeListener listener)
          Adds the given list change listener to the list of list change listeners.
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection c)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(int index)
           
 java.lang.Object getElementType()
          Returns the element type of this observable collection, or null if this observable collection is untyped.
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 java.lang.Object move(int oldIndex, int newIndex)
          Moves the element located at oldIndex to newIndex.
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 void removeListChangeListener(IListChangeListener listener)
          Removes the given list change listener from the list of list change listeners.
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 int size()
           
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 
Methods inherited from interface java.util.List
add, clear
 
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addDisposeListener, addStaleListener, dispose, getRealm, isDisposed, isStale, removeChangeListener, removeDisposeListener, removeStaleListener
 

Method Detail

addListChangeListener

void addListChangeListener(IListChangeListener listener)
Adds the given list change listener to the list of list change listeners.

Parameters:
listener -

removeListChangeListener

void removeListChangeListener(IListChangeListener listener)
Removes the given list change listener from the list of list change listeners. Has no effect if the given listener is not registered as a list change listener.

Parameters:
listener -

size

int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
"TrackedGetter"

isEmpty

boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
"TrackedGetter"

contains

boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List
"TrackedGetter"

iterator

java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.List
"TrackedGetter"

toArray

java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
"TrackedGetter"

toArray

java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
"TrackedGetter"

add

boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List

remove

boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List

containsAll

boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List
"TrackedGetter"

addAll

boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List

addAll

boolean addAll(int index,
               java.util.Collection c)
Specified by:
addAll in interface java.util.List

removeAll

boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List

retainAll

boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List

equals

boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.lang.Object
"TrackedGetter"

hashCode

int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.lang.Object
"TrackedGetter"

get

java.lang.Object get(int index)
Specified by:
get in interface java.util.List
"TrackedGetter"

set

java.lang.Object set(int index,
                     java.lang.Object element)
Specified by:
set in interface java.util.List

move

java.lang.Object move(int oldIndex,
                      int newIndex)
Moves the element located at oldIndex to newIndex. This method is equivalent to calling add(newIndex, remove(oldIndex)).

Implementors should deliver list change notification for the remove and add operations in the same ListChangeEvent, as this allows ListDiff.accept(ListDiffVisitor) to recognize the operation as a move.

Parameters:
oldIndex - the element's position before the move. Must be within the range 0 <= oldIndex < size().
newIndex - the element's position after the move. Must be within the range 0 <= newIndex < size().
Returns:
the element that was moved.
Throws:
java.lang.IndexOutOfBoundsException - if either argument is out of range (0 <= index < size()).
Since:
1.1
See Also:
ListDiffVisitor.handleMove(int, int, Object), ListDiff.accept(ListDiffVisitor)

remove

java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

indexOf

int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List
"TrackedGetter"

lastIndexOf

int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List
"TrackedGetter"

listIterator

java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List
"TrackedGetter"

listIterator

java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List
"TrackedGetter"

subList

java.util.List subList(int fromIndex,
                       int toIndex)
Specified by:
subList in interface java.util.List
"TrackedGetter"

getElementType

java.lang.Object getElementType()
Description copied from interface: IObservableCollection
Returns the element type of this observable collection, or null if this observable collection is untyped.

Specified by:
getElementType in interface IObservableCollection
Returns:
the type of the elements or null if untyped

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.