Search in sources :

Example 6 with ChrDblPair

use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.

the class ChrDblFunUtil method mapChrDbl.

public static ChrDblSource mapChrDbl(ChrDbl_Chr kf0, ChrDbl_Dbl vf0, ChrDblSource source2) {
    ChrDbl_Chr kf1 = kf0.rethrow();
    ChrDbl_Dbl vf1 = vf0.rethrow();
    ChrDblPair pair1 = ChrDblPair.of((char) 0, (double) 0);
    return pair -> {
        boolean b = source2.source2(pair1);
        if (b)
            pair.update(kf1.apply(pair1.t0, pair1.t1), vf1.apply(pair1.t0, pair1.t1));
        return b;
    };
}
Also used : ChrTest(suite.primitive.ChrPrimitives.ChrTest) Iterator(java.util.Iterator) LogUtil(suite.os.LogUtil) Source2(suite.util.FunUtil2.Source2) ChrDblPair(suite.primitive.adt.pair.ChrDblPair) Source(suite.util.FunUtil.Source) NullableSyncQueue(suite.util.NullableSyncQueue) Thread_(suite.util.Thread_) Fun(suite.util.FunUtil.Fun) Pair(suite.adt.pair.Pair) Sink(suite.util.FunUtil.Sink) Fail(suite.util.Fail) DblTest(suite.primitive.DblPrimitives.DblTest) ChrDblPair(suite.primitive.adt.pair.ChrDblPair)

Example 7 with ChrDblPair

use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.

the class ChrDblFunUtil method isAny.

public static <V> boolean isAny(ChrDblPredicate pred0, ChrDblSource source2) {
    ChrDblPredicate pred1 = pred0.rethrow();
    ChrDblPair pair = ChrDblPair.of((char) 0, (double) 0);
    while (source2.source2(pair)) if (pred1.test(pair.t0, pair.t1))
        return true;
    return false;
}
Also used : ChrDblPair(suite.primitive.adt.pair.ChrDblPair)

Example 8 with ChrDblPair

use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.

the class ChrDblFunUtil method map.

public static <T> Source<T> map(ChrDbl_Obj<T> fun0, ChrDblSource source2) {
    ChrDbl_Obj<T> fun1 = fun0.rethrow();
    ChrDblPair pair = ChrDblPair.of((char) 0, (double) 0);
    return () -> source2.source2(pair) ? fun1.apply(pair.t0, pair.t1) : null;
}
Also used : ChrDblPair(suite.primitive.adt.pair.ChrDblPair)

Aggregations

ChrDblPair (suite.primitive.adt.pair.ChrDblPair)8 Iterator (java.util.Iterator)3 Pair (suite.adt.pair.Pair)3 LogUtil (suite.os.LogUtil)2 ChrTest (suite.primitive.ChrPrimitives.ChrTest)2 DblTest (suite.primitive.DblPrimitives.DblTest)2 Fail (suite.util.Fail)2 Fun (suite.util.FunUtil.Fun)2 Sink (suite.util.FunUtil.Sink)2 Source (suite.util.FunUtil.Source)2 Source2 (suite.util.FunUtil2.Source2)2 NullableSyncQueue (suite.util.NullableSyncQueue)2 Thread_ (suite.util.Thread_)2 ChrDblSource (suite.primitive.ChrDblSource)1