Binary Conversion functions (original) (raw)

Brian Goetz brian.goetz at oracle.com
Sun Dec 16 16:42:25 PST 2012


These would be described as {Int,Double,Long}BiFunction<T,U>. We don't have them but I'm open to adding them.

On 12/16/2012 6:39 PM, Doug Lea wrote:

Are there existing interfaces or usage tricks for existing interfaces for what I had placeholded in ConcurrentHashMap for two non-primitive args -> primitive result: /** Interface describing a function mapping two arguments to a double */ public interface ObjectByObjectToDouble<A,B> { double apply(A a, B b); } /** Interface describing a function mapping two arguments to a long */ public interface ObjectByObjectToLong<A,B> { long apply(A a, B b); } /** Interface describing a function mapping two arguments to an int */ public interface ObjectByObjectToInt<A,B> {int apply(A a, B b); } If not, and no one thinks they belong in j.u.functions, I'll just keep them as local interfaces in CHM. -Doug



More information about the lambda-libs-spec-experts mailing list