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
FieldsModifier and TypeFieldDescriptionprivate static final String[]private static final String[]private static final String[]private static final String[]private final LogicalExpressionMemberFactoryFields inherited from class AbstractSplittingParser
log, split -
Constructor Summary
ConstructorsConstructorDescriptionLogicalExpressionParser(String expression, ExpressionLogger log) LogicalExpressionParser(String expression, ExpressionLogger log, LogicalExpressionMemberFactory subexpressionFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate()The method should understand true/false strings, if it is supposed to be used in more complicated expressions.getName()String[]Primary characters are processed first.String[]Primary characters are processed first.String[]Primary characters are processed first.String[]Primary characters are processed first.booleanisLogicalExpressionMember(String originalExpression) ParserNG have a habit, that expression is parsed in constructor, and later evaluated in methood.Methods inherited from class AbstractSplittingParser
concatWithArrayCopy, getHelp, getOriginal, split, toPatternMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LogicalExpressionMemberFactory.LogicalExpressionMember
getHelp
-
Field Details
-
chars1
-
chars2
-
secchars1
-
secchars2
-
subexpressionFactory
-
-
Constructor Details
-
LogicalExpressionParser
-
LogicalExpressionParser
public LogicalExpressionParser(String expression, ExpressionLogger log, LogicalExpressionMemberFactory subexpressionFactory)
-
-
Method Details
-
isLogicalExpressionMember
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
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
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
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
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
- Specified by:
getNamein classAbstractSplittingParser
-
getSubexpressionFactory
-