Package parser
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 String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected String
The name of the operator objectstatic final String
static final String
static final String[]
The instruction set of the parser of this software.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
static Precedence
getPrecedence
(String name) The precedence of the operatorsstatic boolean
static boolean
isAtOperator
(String op) static boolean
static boolean
static boolean
isClosingBrace
(String op) static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
isCubeRoot
(String op) static boolean
static boolean
isExitCommand
(String op) static boolean
isFactorial
(String op) static boolean
static boolean
static boolean
isMulOrDiv
(String op) static boolean
static boolean
isOpeningBrace
(String op) static boolean
static boolean
static boolean
isPermOrComb
(String op) static boolean
isPlusOrMinus
(String op) static boolean
static boolean
isRemainder
(String op) boolean
isSemiColon
(String op) static boolean
static boolean
isSquareRoot
(String op) static boolean
isStoreCommand
(String op) static boolean
static boolean
void
static boolean
validateAll
(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
- Parameters:
scan
- An ArrayList object containing a scanned function.- Returns:
- true if validated
-