added adapter functions

This commit is contained in:
Jonathan Shook
2021-04-21 18:25:07 -05:00
parent 8707ccceb9
commit 9d1d4ce62c

View File

@@ -725,6 +725,13 @@ public class AdaptFunctionsFlexibly {
return l -> f.apply(l).toString();
}
public static LongToIntFunction adapt(IntToDoubleFunction f, LongToIntFunction i1) {
return l -> (int) f.applyAsDouble(((int)l));
}
public static LongToIntFunction adapt(IntToLongFunction f, LongToIntFunction i1) {
return l -> (int)(f.applyAsLong((int) l));
}
}