Skip to content

Instantly share code, notes, and snippets.

@ryanjaeb
Created June 21, 2014 10:06
Show Gist options
  • Save ryanjaeb/841bb08c0c5fa1bea946 to your computer and use it in GitHub Desktop.
Save ryanjaeb/841bb08c0c5fa1bea946 to your computer and use it in GitHub Desktop.
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
public class FilteredListWithoutPredicate {
public static void main(String[] args) {
ObservableList<String> source = FXCollections.observableArrayList();
source.addAll("one", "two", "three");
System.out.println("source size: " + source.size());
System.out.println("without predicate: "
+ new FilteredList<>(source).size());
System.out.println("with predicate: "
+ new FilteredList<>(source, t -> true).size());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment