This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This list is created by dynamically concatenating all the source lists together. | |
*/ | |
public class ConcatenatingList<T> extends ObservableListBase<T> implements ObservableList<T> { | |
private List<ObservableList<T>> sources = new ArrayList<>(); | |
private ListChangeListener<T> listener = this::sourceChanged; | |
@SafeVarargs | |
public ConcatenatingList(ObservableList<T>... source) { | |
super(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Maps elements of type F to E with change listeners working as expected. | |
*/ | |
public class MappedList<E, F> extends TransformationList<E, F> { | |
private final Function<F, E> mapper; | |
private final ArrayList<E> mapped; | |
/** | |
* Creates a new MappedList list wrapped around the source list. | |
* Each element will have the given function applied to it, such that the list is cast through the mapper. |
NewerOlder