1 15 package org.apache.hivemind.examples.impl; 16 17 import org.apache.hivemind.examples.Adder; 18 import org.apache.hivemind.examples.Calculator; 19 import org.apache.hivemind.examples.Divider; 20 import org.apache.hivemind.examples.Multiplier; 21 import org.apache.hivemind.examples.Subtracter; 22 23 30 public class CalculatorImpl implements Calculator 31 { 32 private Adder _adder; 33 private Subtracter _subtracter; 34 private Multiplier _multiplier; 35 private Divider _divider; 36 37 public double add(double arg0, double arg1) 38 { 39 return _adder.add(arg0, arg1); 40 } 41 42 public double subtract(double arg0, double arg1) 43 { 44 return _subtracter.subtract(arg0, arg1); 45 } 46 47 public double multiply(double arg0, double arg1) 48 { 49 return _multiplier.multiply(arg0, arg1); 50 } 51 52 public double divide(double arg0, double arg1) 53 { 54 return _divider.divide(arg0, arg1); 55 } 56 57 public void setAdder(Adder adder) 58 { 59 _adder = adder; 60 } 61 62 public void setDivider(Divider divider) 63 { 64 _divider = divider; 65 } 66 67 public void setMultiplier(Multiplier multiplier) 68 { 69 _multiplier = multiplier; 70 } 71 72 public void setSubtracter(Subtracter subtracter) 73 { 74 _subtracter = subtracter; 75 } 76 77 } 78 | Popular Tags |