| ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hussam.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)
OperationsParser
isNumber
in interface OperationsParser
c
- The charectar public boolean isOperand(char c)
OperatorFactoryDB
plus it will test for group charecters. isOperand
in interface OperationsParser
c
- The charectar public boolean isVariable(char c)
OperationsParser
isVariable
in interface OperationsParser
c
- The charectar public boolean isOperand(java.lang.String word)
OperationsParser
isOperand
in interface OperationsParser
word
- name. public boolean isNumber(java.lang.String word)
OperationsParser
isNumber
in interface OperationsParser
word
- name. public boolean isVariable(java.lang.String word)
OperationsParser
isVariable
in interface OperationsParser
word
- name. public boolean isFunction(java.lang.String word)
OperationsParser
isFunction
in interface OperationsParser
word
- name. public boolean isOpenParenthesis(java.lang.String word)
OperationsParser
isOpenParenthesis
in interface OperationsParser
word
- the word to be evaluated. OperationsParser.isParenthesis(String, String)
public boolean isCloseParenthesis(java.lang.String word)
OperationsParser
isCloseParenthesis
in interface OperationsParser
word
- The word to be evaluated. OperationsParser.isParenthesis(String, String)
public boolean isOpenParenthesis(char c)
OperationsParser
isOpenParenthesis
in interface OperationsParser
c
- the char to be evaluated. OperationsParser.isParenthesis(char, char)
public boolean isCloseParenthesis(char c)
OperationsParser
isCloseParenthesis
in interface OperationsParser
c
- the char to be evaluated. OperationsParser.isParenthesis(char, char)
public boolean isParenthesis(java.lang.String word, java.lang.String word1)
OperationsParser
isParenthesis
in interface OperationsParser
word
- The open parenthesis.word1
- the close parenthesis. public boolean isParenthesis(char c, char c1)
OperationsParser
isParenthesis
in interface OperationsParser
c
- The open parenthesisc1
- the close parenthesis. public boolean isComma(java.lang.String word)
OperationsParser
{1 AND 5 AND 7}
isComma
in interface OperationsParser
word
- The word to be evaluated. public boolean isComma(char c)
OperationsParser
{ 1,3,5,6,7}
isComma
in interface OperationsParser
c
- the char to be evaluated.
| ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |