Issue 31 — Part 1

Quite some changes, but I think this releases #52 #39 (at least when I'm done with this one here on #31) and #75 for others to work on.
Bunch of tests to be added for #52 #39 and #75 as well... 
Nope. The deal is call once and only once. Whatever the return value.

On Thursday, October 2, 2014, vfunshteyn <notifications@github.com> wrote:

> In api/src/main/java/org/ehcache/function/Functions.java:
>
> > + * @author Alex Snaps
> > + */
> > +public class Functions {
> > +
> > +  public static <A, T> Function<A, T> memoize(Function<A, T> f) {
> > +    return new MemoizingFunction<A, T>(f);
> > +  }
> > +
> > +  public static <A, B, T> BiFunction<A, B, T> memoize(BiFunction<A, B, T> f) {
> > +    return new MemoizingBiFunction<A, B, T>(f);
> > +  }
> > +
> > +  private static final class MemoizingFunction<A, T> implements Function<A, T> {
> > +
> > +    private final Function<A, T> function;
> > +    private boolean computed;
>
> Do you really need the flag or can we rely on value being null an
> invariant of computed == false?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ehcache/ehcache3/pull/98/files#r18377046>.
>


-- 
Alex Snaps <alex.snaps@gmail.com>
Principal Software Engineer - Terracotta
http://twitter.com/alexsnaps
http://about.me/alexsnaps
http://www.devoxx4kids.org/quebec/