Class DecoratingObservableList<E>

    • Constructor Detail

      • DecoratingObservableList

        public DecoratingObservableList​(IObservableList<E> decorated,
                                        boolean disposeDecoratedOnDispose)
        Constructs a DecoratingObservableList which decorates the given observable.
        Parameters:
        decorated - the observable list being decorated
        disposeDecoratedOnDispose - whether the decorated observable should be disposed when the decorator is disposed
    • Method Detail

      • addListChangeListener

        public void addListChangeListener​(IListChangeListener<? super E> listener)
        Description copied from interface: IObservableList
        Adds the given list change listener to the list of list change listeners.
        Specified by:
        addListChangeListener in interface IObservableList<E>
        Parameters:
        listener - the change listener to add; not null
      • removeListChangeListener

        public void removeListChangeListener​(IListChangeListener<? super E> listener)
        Description copied from interface: IObservableList
        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.
        Specified by:
        removeListChangeListener in interface IObservableList<E>
        Parameters:
        listener - the change listener to remove; not null
      • fireListChange

        protected void fireListChange​(ListDiff<E> diff)
      • handleListChange

        protected void handleListChange​(ListChangeEvent<? extends E> event)
        Called whenever a ListChangeEvent is received from the decorated observable. By default, this method fires the list change event again, with the decorating observable as the event source. Subclasses may override to provide different behavior.
        Parameters:
        event - the change event received from the decorated observable
      • add

        public void add​(int index,
                        E o)
        Specified by:
        add in interface java.util.List<E>
      • addAll

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

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

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

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

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

        public java.util.ListIterator<E> listIterator​(int index)
        Specified by:
        listIterator in interface IObservableList<E>
        Specified by:
        listIterator in interface java.util.List<E>
      • move

        public E move​(int oldIndex,
                      int newIndex)
        Description copied from interface: IObservableList
        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.

        Specified by:
        move in interface IObservableList<E>
        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.
        See Also:
        ListDiffVisitor.handleMove(int, int, Object), ListDiff.accept(ListDiffVisitor)
      • remove

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

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

        public java.util.List<E> subList​(int fromIndex,
                                         int toIndex)
        Specified by:
        subList in interface IObservableList<E>
        Specified by:
        subList in interface java.util.List<E>
      • dispose

        public void dispose()
        Description copied from interface: IObservable
        Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.
        Specified by:
        dispose in interface IObservable
        Overrides:
        dispose in class DecoratingObservableCollection<E>
      • addListener

        protected void addListener​(java.lang.Object listenerType,
                                   IObservablesListener listener)
        Parameters:
        listenerType - arbitrary object to identify a type of the listener
        listener - the listener to add; not null
      • removeListener

        protected void removeListener​(java.lang.Object listenerType,
                                      IObservablesListener listener)
        Parameters:
        listenerType - arbitrary object to identify a type of the listener
        listener - the listener to remove; not null
      • hasListeners

        protected boolean hasListeners()
      • getRealm

        public Realm getRealm()
        Returns:
        Returns the realm.
      • clone

        protected java.lang.Object clone()
                                  throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException