Go to the documentation of this file.
7package org.sleuthkit.autopsy.timeline.utils;
9import java.util.ArrayList;
11import java.util.function.Function;
12import javafx.collections.ListChangeListener;
13import javafx.collections.ObservableList;
14import javafx.collections.transformation.TransformationList;
19public class MappedList<E, F>
extends TransformationList<E, F> {
33 public E
get(
int index) {
34 return mapper.apply(getSource().
get(index));
39 return getSource().size();
43 protected void sourceChanged(ListChangeListener.Change<? extends F> c) {
44 fireChange(
new ListChangeListener.Change<E>(
this) {
46 public boolean wasAdded() {
51 public boolean wasRemoved() {
52 return c.wasRemoved();
56 public boolean wasReplaced() {
57 return c.wasReplaced();
61 public boolean wasUpdated() {
62 return c.wasUpdated();
66 public boolean wasPermutated() {
67 return c.wasPermutated();
71 public int getPermutation(
int i) {
72 return c.getPermutation(i);
76 protected int[] getPermutation() {
81 throw new AssertionError(
"Unreachable code");
85 public List<E> getRemoved() {
86 ArrayList<E> res =
new ArrayList<>(c.getRemovedSize());
87 for (F e : c.getRemoved()) {
94 public int getFrom() {
104 public boolean next() {
109 public void reset() {
int getViewIndex(int index)
int getSourceIndex(int index)
MappedList(ObservableList<? extends F > source, Function< F, E > mapper)
void sourceChanged(ListChangeListener.Change<? extends F > c)
final Function< F, E > mapper
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.