Class FlatListVal<E>

  • Type Parameters:
    E -
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, javafx.beans.Observable, javafx.collections.ObservableList<E>, DefaultMutableLiveList<E>, org.reactfx.collection.LiveList<E>, org.reactfx.collection.ProperLiveList<E>, org.reactfx.Observable<org.reactfx.collection.LiveList.Observer<? super E,​?>>, org.reactfx.ProperObservable<org.reactfx.collection.LiveList.Observer<? super E,​?>,​org.reactfx.collection.QuasiListChange<? extends E>>

    public class FlatListVal<E>
    extends org.reactfx.collection.LiveListBase<E>
    implements DefaultMutableLiveList<E>
    Turns a Val<LiveList<E>> into a LiveList<E> that is an empty, unmodifiable list when the base Val is null, and otherwise delegates everything (including mutation methods) to the underlying value.

    When the value changes a list change that deletes the list is emitted.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.reactfx.collection.LiveList

        org.reactfx.collection.LiveList.Observer<E extends java.lang.Object,​O extends java.lang.Object>, org.reactfx.collection.LiveList.QuasiChangeObserver<E extends java.lang.Object>, org.reactfx.collection.LiveList.QuasiModificationObserver<E extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      FlatListVal​(org.reactfx.value.Val<? extends javafx.collections.ObservableList<E>> base)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Default Methods 
      Modifier and Type Method Description
      void add​(int index, E element)  
      boolean add​(E e)  
      boolean addAll​(int index, java.util.Collection<? extends E> c)  
      boolean addAll​(java.util.Collection<? extends E> c)  
      void clear()  
      default boolean contains​(java.lang.Object arg0)  
      default boolean containsAll​(java.util.Collection<?> arg0)  
      E get​(int index)  
      default int indexOf​(java.lang.Object arg0)  
      default boolean isEmpty()  
      default java.util.Iterator<E> iterator()  
      default int lastIndexOf​(java.lang.Object arg0)  
      default java.util.ListIterator<E> listIterator()  
      default java.util.ListIterator<E> listIterator​(int arg0)  
      protected org.reactfx.Subscription observeInputs()  
      E remove​(int index)  
      void remove​(int from, int to)  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      E set​(int index, E element)  
      boolean setAll​(java.util.Collection<? extends E> col)  
      int size()  
      default java.util.List<E> subList​(int arg0, int arg1)  
      default java.lang.Object[] toArray()  
      default <T extends java.lang.Object>
      T[]
      toArray​(T[] arg0)  
      • Methods inherited from class org.reactfx.ObservableBase

        addObserver, enqueueNotifications, equals, forEachObserver, getObserverCount, hashCode, isObservingInputs, newObserver, notifyObservers, notifyObservers, observe, removeObserver, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        equals, hashCode, replaceAll, sort, spliterator
      • Methods inherited from interface org.reactfx.collection.LiveList

        addChangeObserver, addListener, addListener, addModificationObserver, addQuasiChangeObserver, addQuasiModificationObserver, changes, collapse, collapseDynamic, map, mapDynamic, memoize, modifications, observeChanges, observeModifications, observeQuasiChanges, observeQuasiModifications, pin, quasiChanges, quasiModifications, reduce, reduceRange, removeChangeObserver, removeListener, removeListener, removeModificationObserver, removeQuasiChangeObserver, removeQuasiModificationObserver, sizeProperty, suspendable
      • Methods inherited from interface org.reactfx.Observable

        addObserver, observe, removeObserver
      • Methods inherited from interface javafx.collections.ObservableList

        filtered, sorted, sorted
      • Methods inherited from interface org.reactfx.collection.ProperLiveList

        contentReplacement, defaultEquals, defaultHashCode, defaultNotificationAccumulator, defaultToString, fireContentReplacement, fireElemInsertion, fireElemRemoval, fireElemReplacement, fireModification, fireRangeInsertion, fireRemoveRange
      • Methods inherited from interface org.reactfx.ProperObservable

        notifyObservers
    • Constructor Detail

      • FlatListVal

        public FlatListVal​(org.reactfx.value.Val<? extends javafx.collections.ObservableList<E>> base)
    • Method Detail

      • observeInputs

        protected org.reactfx.Subscription observeInputs()
        Specified by:
        observeInputs in class org.reactfx.ObservableBase<org.reactfx.collection.LiveList.Observer<? super E,​?>,​org.reactfx.collection.QuasiListChange<? extends E>>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
      • add

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

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

        public 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

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

        public 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

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

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
      • get

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

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

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

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

        public boolean setAll​(java.util.Collection<? extends E> col)
        Specified by:
        setAll in interface javafx.collections.ObservableList<E>
      • remove

        public void remove​(int from,
                           int to)
        Specified by:
        remove in interface javafx.collections.ObservableList<E>
      • isEmpty

        public default boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E extends java.lang.Object>
        Specified by:
        isEmpty in interface java.util.List<E extends java.lang.Object>
      • indexOf

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

        public default int lastIndexOf​(java.lang.Object arg0)
        Specified by:
        lastIndexOf in interface java.util.List<E extends java.lang.Object>
      • contains

        public default boolean contains​(java.lang.Object arg0)
        Specified by:
        contains in interface java.util.Collection<E extends java.lang.Object>
        Specified by:
        contains in interface java.util.List<E extends java.lang.Object>
      • containsAll

        public default boolean containsAll​(java.util.Collection<?> arg0)
        Specified by:
        containsAll in interface java.util.Collection<E extends java.lang.Object>
        Specified by:
        containsAll in interface java.util.List<E extends java.lang.Object>
      • iterator

        public default java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E extends java.lang.Object>
        Specified by:
        iterator in interface java.lang.Iterable<E extends java.lang.Object>
        Specified by:
        iterator in interface java.util.List<E extends java.lang.Object>
      • listIterator

        public default java.util.ListIterator<E> listIterator()
        Specified by:
        listIterator in interface java.util.List<E extends java.lang.Object>
      • listIterator

        public default java.util.ListIterator<E> listIterator​(int arg0)
        Specified by:
        listIterator in interface java.util.List<E extends java.lang.Object>
      • subList

        public default java.util.List<E> subList​(int arg0,
                                                 int arg1)
        Specified by:
        subList in interface java.util.List<E extends java.lang.Object>
      • toArray

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

        public default <T extends java.lang.Object> T[] toArray​(T[] arg0)
        Specified by:
        toArray in interface java.util.Collection<E extends java.lang.Object>
        Specified by:
        toArray in interface java.util.List<E extends java.lang.Object>