cyrillelamal / calculatrice

An extensible calculator desktop application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calculatrice

An extensible calculator desktop application

Installation

Use maven to build and install it.

See mvn package or mvn install

How to add functors

  1. Extend the AbstractOperator class and implement its methods. The implementations receive 2 parameters which type is Number. Each parameter can be either Long or Double. It enables to realize accurate calculations.

  2. 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.

  3. 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.

  4. 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.

About

An extensible calculator desktop application


Languages

Language:Java 100.0%