Binary Conversion functions (original) (raw)

Doug Lea dl at cs.oswego.edu
Sun Dec 16 15:39:07 PST 2012


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