| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthussam.math.operations.parser.ExpressionReader
hussam.math.operations.parser.SmartExpressionReader
public class SmartExpressionReader
This class is Version 5 of all previously created readers. I need people to test this class with different expressions.
Operation| Constructor Summary | |
|---|---|
SmartExpressionReader() Creates a new ExpressionReader. | |
SmartExpressionReader(OperationsParser parser) Creates a new ExpressionReader given this spicific parser. | |
SmartExpressionReader(OperationsParser parser, OperatorSource source) creates a new Expression Reader using a this OperatorSource. | |
SmartExpressionReader(OperatorSource source) Creates a new ExpressionReader given this spicific operator source. | |
| Method Summary | |
|---|---|
java.util.List<Operation> | getExpressionOperations() This will return a list of all read operations. |
java.util.List<java.lang.String> | getExpressionPartitioned() This will return a list of all symbols, numbers, words(variables or function names) and Baraks. |
OperatorSource | getOperatorSource() gets the OperatorSource for all expressions read! |
static void | main(java.lang.String[] args) A test method. |
Operation | readOperation(java.lang.String operationString) Reads an expression |
| Methods inherited from class hussam.math.operations.parser.ExpressionReader |
|---|
getInstance, getInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SmartExpressionReader()
public SmartExpressionReader(OperationsParser parser)
parser - the parser used to parse expressions.public SmartExpressionReader(OperatorSource source)
source - the source used to evaluate expressions.public SmartExpressionReader(OperationsParser parser, OperatorSource source)
parser - The parser used, can be null.source - The source used to find resources. can be null.| Method Detail |
|---|
public OperatorSource getOperatorSource()
OperationReaderOperatorSource for all expressions read.public java.util.List<Operation> getExpressionOperations()
[ConstantNumber, Operand, ConstantNumber]you will notice that (,) commas are treated as null;
public java.util.List<java.lang.String> getExpressionPartitioned()
public Operation readOperation(java.lang.String operationString)
throws MathExceptionOperationReaderoperationString - the expression to be evaluated. MathException - Thrown if the expression has a problemSyntaxErrorException MathLogicException
public static void main(java.lang.String[] args)
throws java.lang.Exceptionjava.lang.Exception
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||