use of suite.primitive.adt.pair.ChrDblPair 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;
};
}
use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.
the class ChrDblFunUtil method isAll.
public static boolean isAll(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 false;
return true;
}
use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.
the class ChrDblFunUtil method fold.
public static <K, V, R> R fold(Fun<Pair<R, ChrDblPair>, R> fun0, R init, ChrDblSource source2) {
Fun<Pair<R, ChrDblPair>, R> fun1 = fun0.rethrow();
ChrDblPair pair = ChrDblPair.of((char) 0, (double) 0);
while (source2.source2(pair)) init = fun1.apply(Pair.of(init, pair));
return init;
}
use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.
the class ChrDblFunUtil method iterator.
public static <V> Iterator<ChrDblPair> iterator(ChrDblSource source2) {
return new Iterator<>() {
private ChrDblPair next = null;
public boolean hasNext() {
if (next == null) {
ChrDblPair next1 = ChrDblPair.of((char) 0, (double) 0);
if (source2.source2(next1))
next = next1;
}
return next != null;
}
public ChrDblPair next() {
ChrDblPair next0 = next;
next = null;
return next0;
}
};
}
use of suite.primitive.adt.pair.ChrDblPair in project suite by stupidsing.
the class ChrDblMap method forEach.
public void forEach(ChrDblSink sink) {
ChrDblPair pair = ChrDblPair.of((char) 0, (double) 0);
ChrDblSource source = source_();
while (source.source2(pair)) sink.sink2(pair.t0, pair.t1);
}
Aggregations