An extensible calculator desktop application
Use maven to build and install it.
-
Extend the
AbstractOperator
class and implement its methods. The implementations receive 2 parameters which type isNumber
. Each parameter can be eitherLong
orDouble
. It enables to realize accurate calculations. -
Register your operator in the list of available operators via
AbstractOperator::registerOperator
. Operators are distinguished by their string representations. So you can register the same functor under different names. -
Modify the view, e.g. extending the current class. You can realize a set of different views (basic, scientific, etc.) . You would reset available functors. You can do it with the
AbstractOperator::resetRegisteredOperators
method. -
Single-char representations of functors will be parsed automatically. If you wish to add functors like sinus, you need to extend the method
parseTokens
in your controller. You can decorate the result of the actual implementation.