/** Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.*********************/package java.util.function;import java.util.Objects;/*** Represents a predicate (boolean-valued function) of one {@code double}-valued* argument. This is the {@code double}-consuming primitive type specialization* of {@link Predicate}.** <p>This is a <a href="package-summary.html">functional interface</a>* whose functional method is {@link #test(double)}.** @see Predicate* @since 1.8*/@FunctionalInterfacepublic interface DoublePredicate {/*** Evaluates this predicate on the given argument.** @param value the input argument* @return {@code true} if the input argument matches the predicate,* otherwise {@code false}*/boolean test(double value);/*** Returns a composed predicate that represents a short-circuiting logical* AND of this predicate and another. When evaluating the composed* predicate, if this predicate is {@code false}, then the {@code other}* predicate is not evaluated.** <p>Any exceptions thrown during evaluation of either predicate are relayed* to the caller; if evaluation of this predicate throws an exception, the* {@code other} predicate will not be evaluated.** @param other a predicate that will be logically-ANDed with this* predicate* @return a composed predicate that represents the short-circuiting logical* AND of this predicate and the {@code other} predicate* @throws NullPointerException if other is null*/default DoublePredicate and(DoublePredicate other) {Objects.requireNonNull(other);return (value) -> test(value) && other.test(value);}/*** Returns a predicate that represents the logical negation of this* predicate.** @return a predicate that represents the logical negation of this* predicate*/default DoublePredicate negate() {return (value) -> !test(value);}/*** Returns a composed predicate that represents a short-circuiting logical* OR of this predicate and another. When evaluating the composed* predicate, if this predicate is {@code true}, then the {@code other}* predicate is not evaluated.** <p>Any exceptions thrown during evaluation of either predicate are relayed* to the caller; if evaluation of this predicate throws an exception, the* {@code other} predicate will not be evaluated.** @param other a predicate that will be logically-ORed with this* predicate* @return a composed predicate that represents the short-circuiting logical* OR of this predicate and the {@code other} predicate* @throws NullPointerException if other is null*/default DoublePredicate or(DoublePredicate other) {Objects.requireNonNull(other);return (value) -> test(value) || other.test(value);}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。