01: package org.obe.convert;
02:
03: import java.util.Comparator;
04: import org.obe.engine.util.UniversalComparator;
05:
06: /**
07: * @author Adrian Price
08: */
09: public abstract class AbstractCalculator implements Calculator {
10: protected static final Comparator comparator = new UniversalComparator();
11:
12: public Object add(Object lhs, Object rhs) {
13: throw new UnsupportedOperationException("add");
14: }
15:
16: public Object subtract(Object lhs, Object rhs) {
17: throw new UnsupportedOperationException("subtract");
18: }
19:
20: public Object multiply(Object lhs, Object rhs) {
21: throw new UnsupportedOperationException("multiply");
22: }
23:
24: public Object divide(Object lhs, Object rhs) {
25: throw new UnsupportedOperationException("divide");
26: }
27:
28: public Object negate(Object rhs) {
29: throw new UnsupportedOperationException("negate");
30: }
31:
32: public int compare(Object lhs, Object rhs) {
33: return comparator.compare(lhs, rhs);
34: }
35: }
|