Class NumberReturningStatsOperator
java.lang.Object
com.github.gbenroscience.parser.Operator
com.github.gbenroscience.parser.NumberReturningStatsOperator
- All Implemented Interfaces:
Validatable
Deals with number returning statistical operators
e.g sum,avg,mode e.t.c and log and antilog
to any base operators
- Author:
- GBEMIRO
-
Field Summary
Fields inherited from class com.github.gbenroscience.parser.Operator
AND, ASSIGN, AT, CLOSE_CIRC_BRAC, CLOSE_SQUARE_BRAC, COLON, COMBINATION, COMMA, CONST, CUBE, CUBE_ROOT, DIVIDE, EN_DASH, EQUALS, EXIT, FACTORIAL, GREATER_OR_EQUALS, GREATER_THAN, INVERSE, LESS_OR_EQUALS, LESS_THAN, MINUS, MULTIPLY, name, OPEN_CIRC_BRAC, OPEN_SQUARE_BRAC, operators, OR, PERMUTATION, PLUS, POWER, REMAINDER, ROOT, SEMI_COLON, SPACE, SQUARE, STORE -
Constructor Summary
ConstructorsConstructorDescriptionNumberReturningStatsOperator(String name, int index, ArrayList<String> scan) -
Method Summary
Methods inherited from class com.github.gbenroscience.parser.Operator
getName, getPrecedence, isAssignmentOperator, isAtOperator, isBinaryOperator, isBracket, isClosingBrace, isClosingBracket, isColon, isComma, isConstantStoreCommand, isCube, isCubeRoot, isEqualsOperator, isExitCommand, isFactorial, isGreaterOrEqualsOperator, isGreaterThanOperator, isInverse, isLessThanOperator, isLessThanOrEqualsOperator, isLogicOperator, isMulOrDiv, isMulOrDivOrRemOrPermOrCombOrPow, isOpeningBrace, isOpeningBracket, isOperatorString, isPermOrComb, isPlusOrMinus, isPower, isRemainder, isSemiColon, isSquare, isSquareRoot, isStoreCommand, isUnaryPostOperator, isUnaryPreOperator, setName, validateAll
-
Constructor Details
-
NumberReturningStatsOperator
- Parameters:
name- The name of this Operator with which it is represented in a math function.index- the location of this Operator object in its parent Function object's scanned ArrayList object.scan- The scanner output
-
-
Method Details
-
setIndex
-
getIndex
public int getIndex()- Returns:
- the index of this operator in the scanned Function that it belongs to.
-
validate
- Specified by:
validatein interfaceValidatable- Parameters:
scan- the ArrayList object that this NumberReturningStatsOperator object exists in. validates the grammatical usage of this operator (by leaving the correctFunction attribute of the Function object un-modified) if the usage of this operator in its immediate environment i.e to its left and right is correct.- Returns:
- true if valid
-