hussam.math.operations.parser
Class MyParser
java.lang.Object
hussam.math.operations.parser.MyParser
- All Implemented Interfaces:
- OperationsParser
public class MyParser
- extends java.lang.Object
- implements OperationsParser
The default implementation for the OperationsParser interface.
Things to note down:
1- Groups of expressions can be done using these charecter sets:
{ '(' , ')' }
2- you can partition the arguments using these character sets:
{ ',' , '¡'}
In the future we could supply extra brackts such as { '{' , '}' , '[' , ']' }
| Method Summary |
|---|
boolean | isFunction(java.lang.String word) Tests for Function name |
boolean | isNumber(char c) returns true if this char is a Number. |
boolean | isNumber(java.lang.String word) Tests for number String. |
boolean | isOperand(char c) This implemetation will test if the charected is set in the operands list in the OperatorFactoryDB plus it will test for group charecters. |
boolean | isOperand(java.lang.String word) Tests for operand String. |
boolean | isVariable(char c) Returns true if this Char is a Variable. |
boolean | isVariable(java.lang.String word) Tests for Variable name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyParser
public MyParser()
isNumber
public boolean isNumber(char c)
- Description copied from interface:
OperationsParser - returns true if this char is a Number.
- Specified by:
isNumber in interface OperationsParser
- Parameters:
c - The charectar - Returns:
- True if the char is a number.
isOperand
public boolean isOperand(char c)
- This implemetation will test if the charected is set in the operands list in the
OperatorFactoryDB plus it will test for group charecters. - Specified by:
isOperand in interface OperationsParser
- Parameters:
c - The charectar - Returns:
- True if the char is an Operand.
isVariable
public boolean isVariable(char c)
- Description copied from interface:
OperationsParser - Returns true if this Char is a Variable.
- Specified by:
isVariable in interface OperationsParser
- Parameters:
c - The charectar - Returns:
- True if the char is a Variable name.
isOperand
public boolean isOperand(java.lang.String word)
- Description copied from interface:
OperationsParser - Tests for operand String.
- Specified by:
isOperand in interface OperationsParser
- Parameters:
word - name. - Returns:
- True if the String is an Operand.
isNumber
public boolean isNumber(java.lang.String word)
- Description copied from interface:
OperationsParser - Tests for number String.
- Specified by:
isNumber in interface OperationsParser
- Parameters:
word - name. - Returns:
- True if the String is a Number.
isVariable
public boolean isVariable(java.lang.String word)
- Description copied from interface:
OperationsParser - Tests for Variable name.
- Specified by:
isVariable in interface OperationsParser
- Parameters:
word - name. - Returns:
- True if the String is Variable Name.
isFunction
public boolean isFunction(java.lang.String word)
- Description copied from interface:
OperationsParser - Tests for Function name
- Specified by:
isFunction in interface OperationsParser
- Parameters:
word - name. - Returns:
- True if the String is a Function name.