Package parser.logical
Class LogicalExpressionParser
java.lang.Object
parser.logical.AbstractSplittingParser
parser.logical.LogicalExpressionParser
- All Implemented Interfaces:
LogicalExpressionMemberFactory.LogicalExpressionMember
public class LogicalExpressionParser extends AbstractSplittingParser implements LogicalExpressionMemberFactory.LogicalExpressionMember
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LogicalExpressionParser(java.lang.String expression, ExpressionLogger log)LogicalExpressionParser(java.lang.String expression, ExpressionLogger log, LogicalExpressionMemberFactory subexpressionFactory) -
Method Summary
Modifier and Type Method Description booleanevaluate()The method should understand true/false strings, if it is supposed to be used in more complicated expressions.java.lang.StringgetName()java.lang.String[]getPrimaryChars1()Primary characters are processed first.java.lang.String[]getPrimaryChars2()Primary characters are processed first.java.lang.String[]getSecondaryChars1()Primary characters are processed first.java.lang.String[]getSecondaryChars2()Primary characters are processed first.LogicalExpressionMemberFactorygetSubexpressionFactory()booleanisLogicalExpressionMember(java.lang.String originalExpression)ParserNG have a habit, that expression is parsed in constructor, and later evaluated in methood.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface parser.logical.LogicalExpressionMemberFactory.LogicalExpressionMember
getHelp
-
Constructor Details
-
LogicalExpressionParser
-
LogicalExpressionParser
public LogicalExpressionParser(java.lang.String expression, ExpressionLogger log, LogicalExpressionMemberFactory subexpressionFactory)
-
-
Method Details
-
isLogicalExpressionMember
public boolean isLogicalExpressionMember(java.lang.String originalExpression)Description copied from interface:LogicalExpressionMemberFactory.LogicalExpressionMemberParserNG have a habit, that expression is parsed in constructor, and later evaluated in methood. So this methid is takin parameter, of future expression, created over dummy example, so we know, whether it will be viable for future constructor.- Specified by:
isLogicalExpressionMemberin interfaceLogicalExpressionMemberFactory.LogicalExpressionMember- Parameters:
originalExpression- future expression to be passed to constructor- Returns:
- whether the expression is most likely targeted for this parser
-
getPrimaryChars1
public java.lang.String[] getPrimaryChars1()Description copied from class:AbstractSplittingParserPrimary characters are processed first. Seondary second. The reason is, if some char is substring of another. Then first msut go the longer ones (which may contain secondary as substring) the goes secondary. Yah. it can be done bette.. by sorting by lenght and so on... but maybe next tim PrimaryChars1 are allowed without spaces- Specified by:
getPrimaryChars1in classAbstractSplittingParser- Returns:
- strings which are substituted first
-
getPrimaryChars2
public java.lang.String[] getPrimaryChars2()Description copied from class:AbstractSplittingParserPrimary characters are processed first. Seondary second. The reason is, if some char is substring of another. Then first msut go the longer ones (which may contain secondary as substring) the goes secondary. Yah. it can be done bette.. by sorting by lenght and so on... but maybe next tim PrimaryChars2 are NOT allowed without spaces- Specified by:
getPrimaryChars2in classAbstractSplittingParser- Returns:
- strings which are substituted first
-
getSecondaryChars1
public java.lang.String[] getSecondaryChars1()Description copied from class:AbstractSplittingParserPrimary characters are processed first. Seondary second. The reason is, if some char is substring of another. Then first msut go the longer ones (which may contain secondary as substring) the goes secondary. Yah. it can be done bette.. by sorting by lenght and so on... but maybe next tim SecondaryChars1 are allowed without spaces- Specified by:
getSecondaryChars1in classAbstractSplittingParser- Returns:
- characters which are subsituted second
-
getSecondaryChars2
public java.lang.String[] getSecondaryChars2()Description copied from class:AbstractSplittingParserPrimary characters are processed first. Seondary second. The reason is, if some char is substring of another. Then first msut go the longer ones (which may contain secondary as substring) the goes secondary. Yah. it can be done bette.. by sorting by lenght and so on... but maybe next tim SecondaryChars2 are NOT allowed without spaces- Specified by:
getSecondaryChars2in classAbstractSplittingParser- Returns:
- characters which are subsituted second
-
evaluate
public boolean evaluate()Description copied from interface:LogicalExpressionMemberFactory.LogicalExpressionMemberThe method should understand true/false strings, if it is supposed to be used in more complicated expressions.- Specified by:
evaluatein interfaceLogicalExpressionMemberFactory.LogicalExpressionMember- Specified by:
evaluatein classAbstractSplittingParser- Returns:
- evaluated expression, usually parsed in constructor
-
getName
public java.lang.String getName()- Specified by:
getNamein classAbstractSplittingParser
-
getSubexpressionFactory
-