19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package javafx.collections.transformation;
26
27 import javafx.collections.ListChangeListener.Change;
28 import java.util.List;
29 import javafx.collections.ListChangeListener;
30 import javafx.collections.ObservableList;
31 import javafx.collections.ObservableListBase;
32 import javafx.collections.WeakListChangeListener;
33
34 /**
35 * A base class for all lists that wraps other lists in a way that changes the list's
36 * elements, order, size or generally it's structure.
37 *
38 * If the source list is observable, a listener is automatically added to it
39 * and the events are delegated to {@link #onSourceChanged(javafx.collections.ListChangeListener.Change)}
40 *
41 * @param <E> the type parameter of this list
42 * @param <F> the upper bound of the type of the source list
43 * @since JavaFX 8.0
44 */
45 public abstract class TransformationList<E, F> extends ObservableListBase<E> implements ObservableList<E> {
46
47 /**
48 * Contains the source list of this transformation list.
49 * This is never null and should be used to directly access source list content
50 */
51 private ObservableList<? extends F> source;
52 /**
53 * This field contains the result of expression "source instanceof {@link javafx.collections.ObservableList}".
54 * If this is true, it is possible to do transforms online.
55 */
56 private ListChangeListener<F> sourceListener;
57
58 /**
59 * Creates a new Transformation list wrapped around the source list.
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package javafx.collections.transformation;
26
27 import javafx.collections.ListChangeListener.Change;
28 import java.util.List;
29 import javafx.collections.ListChangeListener;
30 import javafx.collections.ObservableList;
31 import javafx.collections.ObservableListBase;
32 import javafx.collections.WeakListChangeListener;
33
34 /**
35 * A base class for all lists that wraps other lists in a way that changes the list's
36 * elements, order, size or generally it's structure.
37 *
38 * If the source list is observable, a listener is automatically added to it
39 * and the events are delegated to {@link #sourceChanged(javafx.collections.ListChangeListener.Change)}
40 *
41 * @param <E> the type parameter of this list
42 * @param <F> the upper bound of the type of the source list
43 * @since JavaFX 8.0
44 */
45 public abstract class TransformationList<E, F> extends ObservableListBase<E> implements ObservableList<E> {
46
47 /**
48 * Contains the source list of this transformation list.
49 * This is never null and should be used to directly access source list content
50 */
51 private ObservableList<? extends F> source;
52 /**
53 * This field contains the result of expression "source instanceof {@link javafx.collections.ObservableList}".
54 * If this is true, it is possible to do transforms online.
55 */
56 private ListChangeListener<F> sourceListener;
57
58 /**
59 * Creates a new Transformation list wrapped around the source list.
|