Class Operator
java.lang.Object
parser.Operator
- Direct Known Subclasses:
BinaryOperator, Bracket, ListReturningStatsOperator, LogicOperator, LogOrAntiLogToAnyBase, MOperator, NumberReturningStatsOperator, UnaryPostOperator, UnaryPreOperator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected StringThe name of the operator objectstatic final Stringstatic final Stringstatic final String[]The instruction set of the parser of this software.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()static PrecedencegetPrecedence(String name) The precedence of the operatorsstatic booleanstatic booleanisAtOperator(String op) static booleanstatic booleanstatic booleanisClosingBrace(String op) static booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanisCubeRoot(String op) static booleanstatic booleanisExitCommand(String op) static booleanisFactorial(String op) static booleanstatic booleanstatic booleanisMulOrDiv(String op) static booleanstatic booleanisOpeningBrace(String op) static booleanstatic booleanstatic booleanisPermOrComb(String op) static booleanisPlusOrMinus(String op) static booleanstatic booleanisRemainder(String op) booleanisSemiColon(String op) static booleanstatic booleanisSquareRoot(String op) static booleanisStoreCommand(String op) static booleanstatic booleanvoidstatic booleanvalidateAll(ArrayList<String> scan)
-
Field Details
-
name
The name of the operator object -
PLUS
- See Also:
-
MINUS
- See Also:
-
DIVIDE
- See Also:
-
MULTIPLY
- See Also:
-
EN_DASH
- See Also:
-
FACTORIAL
- See Also:
-
POWER
- See Also:
-
LESS_THAN
- See Also:
-
GREATER_THAN
- See Also:
-
ASSIGN
- See Also:
-
EQUALS
- See Also:
-
LESS_OR_EQUALS
- See Also:
-
GREATER_OR_EQUALS
- See Also:
-
AND
- See Also:
-
OR
- See Also:
-
REMAINDER
- See Also:
-
OPEN_CIRC_BRAC
- See Also:
-
CLOSE_CIRC_BRAC
- See Also:
-
COMMA
- See Also:
-
ROOT
- See Also:
-
CUBE_ROOT
- See Also:
-
PERMUTATION
- See Also:
-
COMBINATION
- See Also:
-
INVERSE
- See Also:
-
SQUARE
- See Also:
-
CUBE
- See Also:
-
OPEN_SQUARE_BRAC
- See Also:
-
CLOSE_SQUARE_BRAC
- See Also:
-
COLON
- See Also:
-
CONST
- See Also:
-
STORE
- See Also:
-
EXIT
- See Also:
-
SPACE
- See Also:
-
SEMI_COLON
- See Also:
-
AT
- See Also:
-
operators
The instruction set of the parser of this software.
-
-
Constructor Details
-
Operator
- Parameters:
name- creates a new form of a valid mathronian Operator
-
-
Method Details
-
setName
- Parameters:
name- set the name of the Operator object
-
getName
- Returns:
- the name of the Operator object
-
isOperatorString
- Parameters:
op- The string to check.- Returns:
- true if the operator is a valid mathronian operator
-
isExitCommand
- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a exit command
-
isSemiColon
-
isAtOperator
-
isStoreCommand
- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a STORE command
-
isConstantStoreCommand
- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a constant storage command
-
isOpeningBrace
- Parameters:
op- the String object in consideration- Returns:
- true if the String object represents a [ character
-
isClosingBrace
- Parameters:
op- the String object in consideration- Returns:
- true if the String object represents a [ character
-
isColon
- Parameters:
op- the String object in consideration- Returns:
- true if the String object represents a : character This operator is used to mark the end-point of Variable initialization e.g [A=2,AA=3,acy=8.838383]:3A+6AA-8acy This instructs the parser to initialize the variables A, AA, acy with the values given and then evaluate the expression
-
isLogicOperator
- Parameters:
op- the String to check- Returns:
- true if the operator is a logic operator the logic operators defined here are ==,<e;,>e;,<,>,|,&
-
isEqualsOperator
- Parameters:
op- the String to check- Returns:
- true if the operator is the EQUALS operator
-
isAssignmentOperator
- Parameters:
op- the String to check- Returns:
- true if the operator is the ASSIGN operator it means that we assign or store the value of the RHS in the LHS and so the LHS must represent a valid variable
-
isBinaryOperator
- Parameters:
op- the String to check- Returns:
- true if the operator is an operator that functions in between 2 numbers or variables i.e,+,-,*,/,^,%,Č,Р
-
isPlusOrMinus
- Parameters:
op- the String to check- Returns:
- true if the operator is the + operator or is the - operator the form is log-¹(num,base)
-
isMulOrDiv
- Parameters:
op- the String to check- Returns:
- true if the operator is the / operator or is the * operator the form is log-¹(num,base)
-
isPermOrComb
- Parameters:
op- the String to check- Returns:
- true if the operator is the permutation operator or is the combination operator the form is log-¹(num,base)
-
isMulOrDivOrRemOrPermOrCombOrPow
- Parameters:
op- the String to check- Returns:
- true if the operator is the + operator or is the - operator the form is log-¹(num,base)
-
isRemainder
- Parameters:
op- the String to check- Returns:
- true if the operator is the REMAINDER operator
-
isPower
- Parameters:
op- the String to check- Returns:
- true if the operator is the POWER operator
-
isBracket
- Parameters:
op- the String to check- Returns:
- true if the operator is the OPEN_CIRC_BRAC or the CLOSE_CIRC_BRAC operator
-
isOpeningBracket
- Parameters:
op- the String to check- Returns:
- true if the operator is the OPEN_CIRC_BRAC operator
-
isClosingBracket
- Parameters:
op- the String to check- Returns:
- true if the operator is the CLOSE_CIRC_BRAC operator
-
isFactorial
- Parameters:
op- the String to check- Returns:
- true if the operator is the FACTORIAL operator
-
isInverse
- Parameters:
op- the String to check- Returns:
- true if the operator is the INVERSE operator
-
isSquareRoot
- Parameters:
op- the String to check- Returns:
- true if the operator is the ROOT operator
-
isCubeRoot
- Parameters:
op- the String to check- Returns:
- true if the operator is the "³√" operator
-
isSquare
- Parameters:
op- the String to check- Returns:
- true if the operator is the SQUARE operator
-
isCube
- Parameters:
op- the String to check- Returns:
- true if the operator is the CUBE operator
-
isUnaryPreOperator
- Parameters:
op- the String to check- Returns:
- true if the operator is a pre-number operator e.g the trig operators,exponential operators,logarithmic operators(not to any base)
-
isUnaryPostOperator
- Parameters:
op- the String to check- Returns:
- true if the operator is a post number operator e.g the inverse operator,the factorial,the square and the cube
-
isComma
- Parameters:
op- the String to check- Returns:
- true if the operator is the comma(,) operator
-
getPrecedence
The precedence of the operators- Parameters:
name- the name of the Operator object- Returns:
- the Operator's Precedence attribute
-
validateAll
-