Module com.iamsoft.util.ui
Class AsynchronousMappedList<I,O>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- javafx.collections.ObservableListBase<E>
-
- javafx.collections.ModifiableObservableListBase<T>
-
- com.iamsoft.util.ui.javafx.collections.DefaultObservableList<E>
-
- com.iamsoft.util.ui.javafx.collections.ObservableArrayList<O>
-
- com.iamsoft.util.ui.javafx.collections.AsynchronousMappedList<I,O>
-
- Type Parameters:
I
- Input type.O
- Output type.
- All Implemented Interfaces:
PermutableObservableList<O>
,Iterable<O>
,Collection<O>
,List<O>
,javafx.beans.Observable
,javafx.collections.ObservableList<O>
public class AsynchronousMappedList<I,O> extends ObservableArrayList<O>
ObservableList that transforms elements from 'source' list on a background thread using potentially slow mappers. When a change is made to the source list, the change is reflected in this list at some time in the future. Changes to the list are made in the same order as they appear in the source list.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.iamsoft.util.ui.javafx.collections.ObservableArrayList
ObservableArrayList.Exposed<E>
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description AsynchronousMappedList(javafx.collections.ObservableList<I> pSourceList, Function<I,O> pMapper, Consumer<Runnable> pThreadScheduler)
AsynchronousMappedList(javafx.collections.ObservableList<I> pSourceList, Function<I,S> pPreMapper, Function<S,T> pMapper, Function<T,O> pPostMapper, Consumer<Runnable> pThreadScheduler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Consumer<Runnable>
createDefaultThreadScheduler()
Creates a default thread scheduler which executes the specified runnables in a single background thread in order of submission.Consumer<Runnable>
getThreadScheduler()
boolean
hasMappingInProgress()
javafx.beans.property.ReadOnlyProperty<Boolean>
mappingInProgressProperty()
-
Methods inherited from class com.iamsoft.util.ui.javafx.collections.ObservableArrayList
addAll, addAll, removeRange
-
Methods inherited from class com.iamsoft.util.ui.javafx.collections.DefaultObservableList
addElementObserver, addElementObservers, clear, contains, doAdd, doRemove, doSet, get, getDelegate, indexOf, lastIndexOf, permutate, removeElementObserver, removeElementObservers, resetElementObserver, size
-
Methods inherited from class javafx.collections.ModifiableObservableListBase
add, remove, remove, removeAll, retainAll, set, setAll, subList
-
Methods inherited from class javafx.collections.ObservableListBase
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll
-
Methods inherited from class java.util.AbstractList
add, equals, hashCode, iterator, listIterator, listIterator
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArray, toArray, 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.util.List
add, add, containsAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
AsynchronousMappedList
public AsynchronousMappedList(javafx.collections.ObservableList<I> pSourceList, Function<I,O> pMapper, Consumer<Runnable> pThreadScheduler)
-
AsynchronousMappedList
public AsynchronousMappedList(javafx.collections.ObservableList<I> pSourceList, Function<I,S> pPreMapper, Function<S,T> pMapper, Function<T,O> pPostMapper, Consumer<Runnable> pThreadScheduler)
- Parameters:
pPreMapper
- Invoked on the JavaFX thread before scheduling a mapping task on a background thread. Can be used, for example, to transform mutable input element to immutable object.pMapper
- Invoked on a background thread.pPostMapper
- Invoked on the JavaFX thread after a mapping task is finished. Can be used, for example, to transform immutable intermediate object to mutable output element.
-
-
Method Detail
-
mappingInProgressProperty
public javafx.beans.property.ReadOnlyProperty<Boolean> mappingInProgressProperty()
-
hasMappingInProgress
public boolean hasMappingInProgress()
-
-