Uses of Interface
calculator.Expression
Packages that use Expression
Package
Description
-
Uses of Expression in calculator
Methods in calculator with parameters of type ExpressionModifier and TypeMethodDescriptionCalculator.eval(Expression e) Evaluates an arithmetic expression and returns its resultCalculator.format(Expression e, Notation notation) Formats an arithmetic expression in a given notationvoidCalculator.print(Expression e) Prints an arithmetic expression provided as input parameter.voidCalculator.printExpressionDetails(Expression e) Prints verbose details of an arithmetic expression provided as input parameter. -
Uses of Expression in calculator.antlr
Subclasses with type arguments of type Expression in calculator.antlrModifier and TypeClassDescriptionclassBuilds Expression objects from the ANTLR parse tree.Methods in calculator.antlr that return ExpressionModifier and TypeMethodDescriptionAnalyze a string input and return an Expression object representing the parsed expression.ParserVisitor.visitAtomComplex(calculatorParser.AtomComplexContext ctx) Rule: atom : complex #AtomComplexParserVisitor.visitAtomNumber(calculatorParser.AtomNumberContext ctx) Rule: atom : number #AtomNumberParserVisitor.visitCompleteInfix(calculatorParser.CompleteInfixContext ctx) Rule: complete : expressionIN EOF #CompleteInfixParserVisitor.visitCompletePostfix(calculatorParser.CompletePostfixContext ctx) Rule: complete : expressionPOST EOF #CompletePostfixParserVisitor.visitCompletePrefix(calculatorParser.CompletePrefixContext ctx) Rule: complete : expressionPRE EOF #CompletePrefixParserVisitor.visitComplexNumber(calculatorParser.ComplexNumberContext ctx) Rule: complex : number?ParserVisitor.visitConstEuler(calculatorParser.ConstEulerContext ctx) Rule: constant : EULER #ConstEulerParserVisitor.visitConstPi(calculatorParser.ConstPiContext ctx) Rule: constant : PI #ConstPiParserVisitor.visitINAddSub(calculatorParser.INAddSubContext ctx) Rule: expressionIN : multExp ((PLUS | MINUS) multExp)* #INAddSubParserVisitor.visitInfixFunctionCall(calculatorParser.InfixFunctionCallContext ctx) Rule: functionIN : funcname LPAR expressionIN (COMMA expressionIN)* RPAR #InfixFunctionCallParserVisitor.visitINFunction(calculatorParser.INFunctionContext ctx) Rule: atomIN : functionIN #INFunctionParserVisitor.visitINImplicitMult(calculatorParser.INImplicitMultContext ctx) Rule: atomIN : (LPAR expressionIN RPAR)?ParserVisitor.visitINMult(calculatorParser.INMultContext ctx) Rule: multExp : powExp (LPAR powExp RPAR)* #INMultParserVisitor.visitINParenthesis(calculatorParser.INParenthesisContext ctx) Rule: atomIN : (LPAR expressionIN RPAR) #INParenthesisParserVisitor.visitINPow(calculatorParser.INPowContext ctx) Rule: powExp : atomIN (POW atomIN)* #INPowParserVisitor.visitINSignedAtom(calculatorParser.INSignedAtomContext ctx) Rule: atomIN : (PLUS | MINUS)* atom (constant)* #INSignedAtomParserVisitor.visitINTimesDiv(calculatorParser.INTimesDivContext ctx) Rule: multExp : powExp ((TIMES | DIV) powExp)* #INTimesDivParserVisitor.visitNumberConstant(calculatorParser.NumberConstantContext ctx) Rule: number : constant #NumberConstantParserVisitor.visitNumberReal(calculatorParser.NumberRealContext ctx) Rule: number : real #NumberRealParserVisitor.visitNumberScientific(calculatorParser.NumberScientificContext ctx) Rule: number : scientific #NumberScientificParserVisitor.visitPost2Param(calculatorParser.Post2ParamContext ctx) Rule: expressionPOST : expressionPOST expressionPOST operator #Post2ParamParserVisitor.visitPostAtom(calculatorParser.PostAtomContext ctx) Rule: expressionPOST : atom #PostAtomParserVisitor.visitPostFunc(calculatorParser.PostFuncContext ctx) Rule: expressionPOST : LPAR expressionPOST+ RPAR funcname | LPAR expressionPOST (COMMA expressionPOST)* RPAR funcname #PostFuncParserVisitor.visitPostFunc1Param(calculatorParser.PostFunc1ParamContext ctx) Rule: expressionPOST : expressionPOST funcname #PostFunc1ParamParserVisitor.visitPostMult(calculatorParser.PostMultContext ctx) Rule: expressionPOST : LPAR expressionPOST expressionPOST+ RPAR | LPAR expressionPOST (COMMA expressionPOST)+ RPAR #PostMultParserVisitor.visitPostPlus2Param(calculatorParser.PostPlus2ParamContext ctx) Rule: expressionPOST : LPAR expressionPOST expressionPOST+ RPAR operator | LPAR expressionPOST (COMMA expressionPOST)+ RPAR operator #PostPlus2ParamParserVisitor.visitPre2Param(calculatorParser.Pre2ParamContext ctx) Rule: expressionPRE : operator expressionPRE expressionPRE #Pre2ParamParserVisitor.visitPreAtom(calculatorParser.PreAtomContext ctx) Rule: expressionPRE : atom #PreAtomParserVisitor.visitPreFunc(calculatorParser.PreFuncContext ctx) Rule: expressionPRE : funcname LPAR expressionPRE+ RPAR | funcname LPAR expressionPRE (COMMA expressionPRE)* RPAR #PreFuncParserVisitor.visitPreFunc1Param(calculatorParser.PreFunc1ParamContext ctx) Rule: expressionPRE : funcname expressionPRE #PreFunc1ParamParserVisitor.visitPreMult(calculatorParser.PreMultContext ctx) Rule: expressionPRE : LPAR expressionPRE expressionPRE+ RPAR | LPAR expressionPRE (COMMA expressionPRE)+ RPAR #PreMultParserVisitor.visitPrePlus2Param(calculatorParser.PrePlus2ParamContext ctx) Rule: expressionPRE : operator LPAR expressionPRE expressionPRE+ RPAR | operator LPAR expressionPRE (COMMA expressionPRE)+ RPAR #PrePlus2ParamParserVisitor.visitRealNumber(calculatorParser.RealNumberContext ctx) Rule: real : INT (DOT INT)?ParserVisitor.visitScientificNumber(calculatorParser.ScientificNumberContext ctx) Rule: scientific : (real | INT) E (PLUS | MINUS)? -
Uses of Expression in calculator.atoms
Subinterfaces of Expression in calculator.atomsModifier and TypeInterfaceDescriptioninterfaceAtom abstract class An Atom represents a number (or an operand of operations).Classes in calculator.atoms that implement ExpressionModifier and TypeClassDescriptionclassComplex Number type is used to represent complex e.g. 3 + 2iclassIntegerAtom is a concrete class that represents arithmetic (integer) numbers, which are Atoms, a special kind of Expressions, just like operations are.classRationnal Number type is used to represent fractions e.g. 1/2classReal is a concrete class that represents arithmetic (Real) numbers, which are Atoms, a special kind of Expressions. -
Uses of Expression in calculator.functions
Classes in calculator.functions that implement ExpressionModifier and TypeClassDescriptionfinal classThis class represents the arithmetic unary operation "acos".final classThis class represents the arithmetic unary operation "asin".final classThis class represents the arithmetic unary operation "atan".classfinal classThis class represents the arithmetic unary operation "cosh".final classThis class represents the arithmetic unary operation "cos".final classThis class represents the natural logarithm unary operation "ln".classThis class represents the arithmetic binary operation "log(x, base)".final classThis class represents the arithmetic unary operation "sinh".final classThis class represents the arithmetic unary operation "sin".final classThis class represents the square root unary operation "sqrt".final classThis class represents the arithmetic unary operation "tan".final classThis class represents the arithmetic unary operation "tanh".classUnaryFunction is an abstract class that represents unary arithmetic operations, which are a special kind of Expressions, just like binary operations are.Fields in calculator.functions declared as ExpressionModifier and TypeFieldDescriptionUnaryFunction.argThe expression passed as an argument to the arithmetic operationMethods in calculator.functions that return ExpressionModifier and TypeMethodDescriptionUnaryFunction.getArg()getter method to return the argument of an arithmetic operation.BinaryFunction.getFirstArg()BinaryFunction.getSecondArg()Methods in calculator.functions with parameters of type ExpressionModifier and TypeMethodDescriptionvoidBinaryFunction.setFirstArg(Expression firstArg) voidBinaryFunction.setSecondArg(Expression secondArg) Constructors in calculator.functions with parameters of type ExpressionModifierConstructorDescriptionArccosinus(Expression arg) Class constructor specifying an Expression to apply the arccosine function.Arcsinus(Expression arg) Class constructor specifying an Expression to apply the arcsine function.Arctangente(Expression arg) Class constructor specifying an Expression to apply the arctangent function.BinaryFunction(Expression firstArg, Expression secondArg) Cosh(Expression arg) Class constructor specifying an Expression to apply the hyperbolic cosine function.Cosinus(Expression arg) Class constructor specifying an Expression to apply the cosine function.Ln(Expression arg) Log(Expression base, Expression number) Sinh(Expression arg) Class constructor specifying an Expression to apply the hyperbolic sine function.Sinus(Expression arg) Class constructor specifying an Expression to apply the sine function.Sqrt(Expression arg) Tangente(Expression arg) Class constructor specifying an Expression to apply the tangent function.Tanh(Expression arg) Class constructor specifying an Expression to apply the hyperbolic tangent function.protectedUnaryFunction(Expression arg) To construct a unary operation with an expression as argument -
Uses of Expression in calculator.operations
Classes in calculator.operations that implement ExpressionModifier and TypeClassDescriptionfinal classThis class represents the arithmetic division operation "/".final classThis class represents the arithmetic operation "-".classOperation is an abstract class that represents arithmetic operations, which are a special kind of Expressions, just like numbers are.final classThis class represents the arithmetic sum operation "+".final classfinal classThis class represents the arithmetic multiplication operation "*".Fields in calculator.operations with type parameters of type ExpressionModifier and TypeFieldDescriptionOperation.argsThe list of expressions passed as an argument to the arithmetic operationMethods in calculator.operations that return types with arguments of type ExpressionModifier and TypeMethodDescriptionOperation.getArgs()getter method to return the number of arguments of an arithmetic operation.Method parameters in calculator.operations with type arguments of type ExpressionModifier and TypeMethodDescriptionvoidOperation.addMoreParams(List<Expression> params) Add more parameters to the existing list of parametersConstructor parameters in calculator.operations with type arguments of type ExpressionModifierConstructorDescriptionDivides(List<Expression> elist) Class constructor specifying a number of Expressions to divide.Minus(List<Expression> elist) Class constructor specifying a number of Expressions to subtract.protectedOperation(List<Expression> elist) To construct an operation with a list of expressions as arguments, as well as the Notation used to represent the operation.Plus(List<Expression> elist) Class constructor specifying a number of Expressions to add.Power(List<Expression> elist) Times(List<Expression> elist) Class constructor specifying a number of Expressions to multiply.