Interface IObservableList<E>

  • Type Parameters:
    E - the type of elements in this collection
    All Superinterfaces:
    java.util.Collection<E>, IObservable, IObservableCollection<E>, java.lang.Iterable<E>, java.util.List<E>
    All Known Subinterfaces:
    ISWTObservableList<E>, IViewerObservableList<E>
    All Known Implementing Classes:
    AbstractObservableList, ComputedList, DecoratingObservableList, MultiList, ObservableList, WritableList

    public interface IObservableList<E>
    extends java.util.List<E>, IObservableCollection<E>
    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 classes that implement this interface.

    Authors of extensions to the databinding framework may extend this interface and indirectly implement it, but if doing so must also extend one of the framework classes. (Use an API problem filter to suppress the resulting warning.)

    Direct implementers of this interface outside of the framework will be broken in future releases when methods are added to this interface.

    • Method Detail

      • addListChangeListener

        void addListChangeListener​(IListChangeListener<? super E> listener)
        Adds the given list change listener to the list of list change listeners.
        Parameters:
        listener - the change listener to add; not null
      • removeListChangeListener

        void removeListChangeListener​(IListChangeListener<? super E> 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 - the change listener to remove; not null
      • size

        int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
        "TrackedGetter"
      • isEmpty

        boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Specified by:
        isEmpty in interface java.util.List<E>
        "TrackedGetter"
      • contains

        boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.List<E>
        "TrackedGetter"
      • iterator

        java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.List<E>
        "TrackedGetter"
      • toArray

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

        <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<E>
        Specified by:
        toArray in interface java.util.List<E>
        "TrackedGetter"
      • add

        boolean add​(E o)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.List<E>
      • remove

        boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<E>
        Specified by:
        remove in interface java.util.List<E>
      • containsAll

        boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<E>
        Specified by:
        containsAll in interface java.util.List<E>
        "TrackedGetter"
      • addAll

        boolean addAll​(java.util.Collection<? extends E> c)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
      • addAll

        boolean addAll​(int index,
                       java.util.Collection<? extends E> c)
        Specified by:
        addAll in interface java.util.List<E>
      • removeAll

        boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<E>
        Specified by:
        removeAll in interface java.util.List<E>
      • retainAll

        boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<E>
        Specified by:
        retainAll in interface java.util.List<E>
      • equals

        boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.List<E>
        Overrides:
        equals in class java.lang.Object
        "TrackedGetter"
      • hashCode

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

        E get​(int index)
        Specified by:
        get in interface java.util.List<E>
        "TrackedGetter"
      • set

        E set​(int index,
              E element)
        Specified by:
        set in interface java.util.List<E>
      • move

        E 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

        E remove​(int index)
        Specified by:
        remove in interface java.util.List<E>
      • indexOf

        int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<E>
        "TrackedGetter"
      • lastIndexOf

        int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<E>
        "TrackedGetter"
      • listIterator

        java.util.ListIterator<E> listIterator()
        Specified by:
        listIterator in interface java.util.List<E>
        "TrackedGetter"
      • listIterator

        java.util.ListIterator<E> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<E>
        "TrackedGetter"
      • subList

        java.util.List<E> subList​(int fromIndex,
                                  int toIndex)
        Specified by:
        subList in interface java.util.List<E>
        "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<E>
        Returns:
        the type of the elements or null if untyped