當前位置: 首頁>>代碼示例>>Java>>正文


Java DoublePredicate.test方法代碼示例

本文整理匯總了Java中java.util.function.DoublePredicate.test方法的典型用法代碼示例。如果您正苦於以下問題:Java DoublePredicate.test方法的具體用法?Java DoublePredicate.test怎麽用?Java DoublePredicate.test使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.function.DoublePredicate的用法示例。


在下文中一共展示了DoublePredicate.test方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: filter

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public final DoubleStream filter(DoublePredicate predicate) {
    Objects.requireNonNull(predicate);
    return new StatelessOp<Double>(this, StreamShape.DOUBLE_VALUE,
                                   StreamOpFlag.NOT_SIZED) {
        @Override
        Sink<Double> opWrapSink(int flags, Sink<Double> sink) {
            return new Sink.ChainedDouble<Double>(sink) {
                @Override
                public void begin(long size) {
                    downstream.begin(-1);
                }

                @Override
                public void accept(double t) {
                    if (predicate.test(t))
                        downstream.accept(t);
                }
            };
        }
    };
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:23,代碼來源:DoublePipeline.java

示例2: makeDouble

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
/**
 * Constructs a quantified predicate matcher for a {@code DoubleStream}.
 *
 * @param predicate the {@code Predicate} to apply to stream elements
 * @param matchKind the kind of quantified match (all, any, none)
 * @return a {@code TerminalOp} implementing the desired quantified match
 *         criteria
 */
public static TerminalOp<Double, Boolean> makeDouble(DoublePredicate predicate,
                                                     MatchKind matchKind) {
    Objects.requireNonNull(predicate);
    Objects.requireNonNull(matchKind);
    class MatchSink extends BooleanTerminalSink<Double> implements Sink.OfDouble {

        MatchSink() {
            super(matchKind);
        }

        @Override
        public void accept(double t) {
            if (!stop && predicate.test(t) == matchKind.stopOnPredicateMatches) {
                stop = true;
                value = matchKind.shortCircuitResult;
            }
        }
    }

    return new MatchOp<>(StreamShape.DOUBLE_VALUE, matchKind, MatchSink::new);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:30,代碼來源:MatchOps.java

示例3: allMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
/**
 * Test whether all elements of a double[] array satisfy a double -> boolean predicate
 */
public static boolean allMatch(final double[] array, final DoublePredicate pred) {
	JointCallingUtils.nonNull(array, "array may not be null");
    JointCallingUtils.nonNull(pred, "predicate may not be null");
    for (final double x : array) {
        if (!pred.test(x)) {
            return false;
        }
    }
    return true;
}
 
開發者ID:BGI-flexlab,項目名稱:SOAPgaea,代碼行數:14,代碼來源:GvcfMathUtils.java

示例4: allMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
default boolean allMatch(@NonNull final DoublePredicate predicate) {
  return predicate.test(this.x()) && predicate.test(this.y()) && predicate.test(this.z()) && predicate.test(this.w());
}
 
開發者ID:KyoriPowered,項目名稱:math,代碼行數:5,代碼來源:Vector4d.java

示例5: anyMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
default boolean anyMatch(@NonNull final DoublePredicate predicate) {
  return predicate.test(this.x()) || predicate.test(this.y()) || predicate.test(this.z()) || predicate.test(this.w());
}
 
開發者ID:KyoriPowered,項目名稱:math,代碼行數:5,代碼來源:Vector4d.java

示例6: allMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
default boolean allMatch(@NonNull final DoublePredicate predicate) {
  return predicate.test(this.x()) && predicate.test(this.y()) && predicate.test(this.z());
}
 
開發者ID:KyoriPowered,項目名稱:math,代碼行數:5,代碼來源:Vector3d.java

示例7: anyMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
default boolean anyMatch(@NonNull final DoublePredicate predicate) {
  return predicate.test(this.x()) || predicate.test(this.y()) || predicate.test(this.z());
}
 
開發者ID:KyoriPowered,項目名稱:math,代碼行數:5,代碼來源:Vector3d.java

示例8: allMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
default boolean allMatch(@NonNull final DoublePredicate predicate) {
  return predicate.test(this.x()) && predicate.test(this.y());
}
 
開發者ID:KyoriPowered,項目名稱:math,代碼行數:5,代碼來源:Vector2d.java

示例9: anyMatch

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
default boolean anyMatch(@NonNull final DoublePredicate predicate) {
  return predicate.test(this.x()) || predicate.test(this.y());
}
 
開發者ID:KyoriPowered,項目名稱:math,代碼行數:5,代碼來源:Vector2d.java

示例10: every

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public boolean every(DoublePredicate f) {
  return f.test(x) && f.test(y) && f.test(z) && f.test(w);
}
 
開發者ID:lacuna,項目名稱:artifex,代碼行數:5,代碼來源:Vec4.java

示例11: any

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public boolean any(DoublePredicate f) {
  return f.test(x) || f.test(y) || f.test(z) || f.test(w);
}
 
開發者ID:lacuna,項目名稱:artifex,代碼行數:5,代碼來源:Vec4.java

示例12: every

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public boolean every(DoublePredicate f) {
  return f.test(x) && f.test(y);
}
 
開發者ID:lacuna,項目名稱:artifex,代碼行數:5,代碼來源:Vec2.java

示例13: any

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public boolean any(DoublePredicate f) {
  return f.test(x) || f.test(y);
}
 
開發者ID:lacuna,項目名稱:artifex,代碼行數:5,代碼來源:Vec2.java

示例14: every

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public boolean every(DoublePredicate f) {
  return f.test(x);
}
 
開發者ID:lacuna,項目名稱:artifex,代碼行數:5,代碼來源:Vec1.java

示例15: any

import java.util.function.DoublePredicate; //導入方法依賴的package包/類
@Override
public boolean any(DoublePredicate f) {
  return f.test(x);
}
 
開發者ID:lacuna,項目名稱:artifex,代碼行數:5,代碼來源:Vec1.java


注:本文中的java.util.function.DoublePredicate.test方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。