Package calc

Class AddAndSub


  • public class AddAndSub
    extends Expression
    Addition and subtraction evaluator. Both included in one evaluator due to order equivalence.
    • Constructor Summary

      Constructors 
      Constructor Description
      AddAndSub​(int i)  
    • Method Summary

      Modifier and Type Method Description
      double accept​(java.lang.String expression)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AddAndSub

        public AddAndSub​(int i)
        Parameters:
        i - Expression depth.
    • Method Detail

      • accept

        public double accept​(java.lang.String expression)
        Specified by:
        accept in class Expression
        Parameters:
        expression - Some math expression.
        Returns:
        Evaluated result.