Package parser.logical
Class ComparingExpressionParser
java.lang.Object
parser.logical.AbstractSplittingParser
parser.logical.ComparingExpressionParser
- All Implemented Interfaces:
LogicalExpressionMemberFactory.LogicalExpressionMember
public class ComparingExpressionParser extends AbstractSplittingParser implements LogicalExpressionMemberFactory.LogicalExpressionMember
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComparingExpressionParser.ComparingExpressionParserFactory -
Field Summary
-
Constructor Summary
Constructors Constructor Description ComparingExpressionParser()ComparingExpressionParser(java.lang.String expression, ExpressionLogger log) -
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.booleanisLogicalExpressionMember(java.lang.String originalExpression)ParserNG have a habit, that expression is parsed in constructor, and later evaluated in methood.static booleanparseBooleanStrict(java.lang.String trim, ExpressionLogger log)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
-
ComparingExpressionParser
-
ComparingExpressionParser
public ComparingExpressionParser()
-
-
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
-
parseBooleanStrict
-
getName
public java.lang.String getName()- Specified by:
getNamein classAbstractSplittingParser
-