Example usage for java.util.function Predicate and

List of usage examples for java.util.function Predicate and

Introduction

In this page you can find the example usage for java.util.function Predicate and.

Prototype

default Predicate<T> and(Predicate<? super T> other) 

Source Link

Document

Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.

Usage

From source file:qupath.lib.gui.tma.TMASummaryViewer.java

public TMASummaryViewer(final Stage stage) {
    if (stage == null)
        this.stage = new Stage();
    else//from   w w  w.ja va 2s .c o m
        this.stage = stage;

    combinedPredicate = Bindings.createObjectBinding(() -> {
        Predicate<TMAEntry> thisPredicate = predicateHideMissing.getValue();
        if (predicateMeasurements.get() != null)
            thisPredicate = thisPredicate.and(predicateMeasurements.getValue());
        if (predicateMetadataFilter.get() != null)
            thisPredicate = thisPredicate.and(predicateMetadataFilter.getValue());
        return thisPredicate;
    }, predicateMeasurements, predicateHideMissing, predicateMetadataFilter);

    initialize();
    this.stage.setTitle("TMA Results Viewer");
    this.stage.setScene(scene);
    new DragDropTMADataImportListener(this);
}