Add all the A tasks

This commit is contained in:
Ingy döt Net 2013-04-10 14:58:50 -07:00
parent 2dd7375f96
commit 051504d65b
1608 changed files with 18584 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import com.google.common.base.Function;
public class AccumulatorFactory {
private static Function<Double, Double> accumulator(final Double elem) {
return new Function<Double, Double>() {
Double sum = elem;
@Override public Double apply(Double val) {
return sum += val;
}
};
}
public static void main(String[] args) {
Function<Double, Double> x = accumulator(1d);
x.apply(5d);
System.out.println(accumulator(3d));
System.out.println(x.apply(2.3));
}
}