Search in sources :

Example 1 with Source2

use of suite.util.FunUtil2.Source2 in project suite by stupidsing.

the class ChrDblFunUtil method map2.

public static <K1, V1, T> Source2<K1, V1> map2(ChrDbl_Obj<K1> kf0, ChrDbl_Obj<V1> vf0, ChrDblSource source2) {
    ChrDbl_Obj<K1> kf1 = kf0.rethrow();
    ChrDbl_Obj<V1> 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 2 with Source2

use of suite.util.FunUtil2.Source2 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)

Aggregations

Iterator (java.util.Iterator)2 Pair (suite.adt.pair.Pair)2 LogUtil (suite.os.LogUtil)2 ChrTest (suite.primitive.ChrPrimitives.ChrTest)2 DblTest (suite.primitive.DblPrimitives.DblTest)2 ChrDblPair (suite.primitive.adt.pair.ChrDblPair)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