| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthussam.math.operations.parser.MyParser
public class MyParser
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:
{ ',' , '¡'}
3- Logical Operations are: { '<' , '>' , '==' , '<=' , '>=' }
4- Extended Logical Operations : { '!' , '&' , '|' }
5- Assingment key: { '=' }
| Constructor Summary | |
|---|---|
MyParser() | |
| Method Summary | |
|---|---|
boolean | isCloseParenthesis(char c) Returns true if this char indicated a close parenthesis such as ), ], } . |
boolean | isCloseParenthesis(java.lang.String word) Returns true if this word indicates a close parenthesis such as ), ], } or even END. |
boolean | isComma(char c) Returns true if the char acts like a partioner in a group. |
boolean | isComma(java.lang.String word) returns true if this word act as a partition in a group, for example you can have the word AND as a partition for this group. |
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 | isOpenParenthesis(char c) Returns true if this char is an open Parenthesis. such as (, [, { etc. |
boolean | isOpenParenthesis(java.lang.String word) Returns true if this String is an open Parenthesis. such as (, [, { or even Start, Begin etc. |
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 | isParenthesis(char c, char c1) Returns true of these two chars indicate a pair of parenthesis such as () , [], {}, <> or any other char! |
boolean | isParenthesis(java.lang.String word, java.lang.String word1) Returns true if these two words indicate a block of code, like Start/End, Begin/Finish. |
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 |
| Constructor Detail |
|---|
public MyParser()
| Method Detail |
|---|
public boolean isNumber(char c)
OperationsParserisNumber in interface OperationsParserc - The charectar public boolean isOperand(char c)
OperatorFactoryDB plus it will test for group charecters. isOperand in interface OperationsParserc - The charectar public boolean isVariable(char c)
OperationsParserisVariable in interface OperationsParserc - The charectar public boolean isOperand(java.lang.String word)
OperationsParserisOperand in interface OperationsParserword - name. public boolean isNumber(java.lang.String word)
OperationsParserisNumber in interface OperationsParserword - name. public boolean isVariable(java.lang.String word)
OperationsParserisVariable in interface OperationsParserword - name. public boolean isFunction(java.lang.String word)
OperationsParserisFunction in interface OperationsParserword - name. public boolean isOpenParenthesis(java.lang.String word)
OperationsParserisOpenParenthesis in interface OperationsParserword - the word to be evaluated. OperationsParser.isParenthesis(String, String)public boolean isCloseParenthesis(java.lang.String word)
OperationsParserisCloseParenthesis in interface OperationsParserword - The word to be evaluated. OperationsParser.isParenthesis(String, String)public boolean isOpenParenthesis(char c)
OperationsParserisOpenParenthesis in interface OperationsParserc - the char to be evaluated. OperationsParser.isParenthesis(char, char)public boolean isCloseParenthesis(char c)
OperationsParserisCloseParenthesis in interface OperationsParserc - the char to be evaluated. OperationsParser.isParenthesis(char, char)
public boolean isParenthesis(java.lang.String word,
java.lang.String word1)OperationsParserisParenthesis in interface OperationsParserword - The open parenthesis.word1 - the close parenthesis.
public boolean isParenthesis(char c,
char c1)OperationsParserisParenthesis in interface OperationsParserc - The open parenthesisc1 - the close parenthesis. public boolean isComma(java.lang.String word)
OperationsParser{1 AND 5 AND 7}isComma in interface OperationsParserword - The word to be evaluated. public boolean isComma(char c)
OperationsParser{ 1,3,5,6,7}isComma in interface OperationsParserc - the char to be evaluated.
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||