Class ComparingExpressionParser

java.lang.Object
parser.logical.AbstractSplittingParser
parser.logical.ComparingExpressionParser
All Implemented Interfaces:
LogicalExpressionMemberFactory.LogicalExpressionMember

public class ComparingExpressionParser extends AbstractSplittingParser implements LogicalExpressionMemberFactory.LogicalExpressionMember
  • Field Details

    • primaryChars1

      private static final String[] primaryChars1
    • primaryChars2

      private static final String[] primaryChars2
    • secondaryChars1

      private static final String[] secondaryChars1
    • secondaryChars2

      private static final String[] secondaryChars2
  • Constructor Details

    • ComparingExpressionParser

      public ComparingExpressionParser(String expression, ExpressionLogger log)
    • ComparingExpressionParser

      public ComparingExpressionParser()
  • Method Details

    • isLogicalExpressionMember

      public boolean isLogicalExpressionMember(String originalExpression)
      Description copied from interface: LogicalExpressionMemberFactory.LogicalExpressionMember
      ParserNG 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:
      isLogicalExpressionMember in interface LogicalExpressionMemberFactory.LogicalExpressionMember
      Parameters:
      originalExpression - future expression to be passed to constructor
      Returns:
      whether the expression is most likely targeted for this parser
    • getPrimaryChars1

      public String[] getPrimaryChars1()
      Description copied from class: AbstractSplittingParser
      Primary 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:
      getPrimaryChars1 in class AbstractSplittingParser
      Returns:
      strings which are substituted first
    • getPrimaryChars2

      public String[] getPrimaryChars2()
      Description copied from class: AbstractSplittingParser
      Primary 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:
      getPrimaryChars2 in class AbstractSplittingParser
      Returns:
      strings which are substituted first
    • getSecondaryChars1

      public String[] getSecondaryChars1()
      Description copied from class: AbstractSplittingParser
      Primary 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:
      getSecondaryChars1 in class AbstractSplittingParser
      Returns:
      characters which are subsituted second
    • getSecondaryChars2

      public String[] getSecondaryChars2()
      Description copied from class: AbstractSplittingParser
      Primary 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:
      getSecondaryChars2 in class AbstractSplittingParser
      Returns:
      characters which are subsituted second
    • evaluate

      public boolean evaluate()
      Description copied from interface: LogicalExpressionMemberFactory.LogicalExpressionMember
      The method should understand true/false strings, if it is supposed to be used in more complicated expressions.
      Specified by:
      evaluate in interface LogicalExpressionMemberFactory.LogicalExpressionMember
      Specified by:
      evaluate in class AbstractSplittingParser
      Returns:
      evaluated expression, usually parsed in constructor
    • parseBooleanStrict

      public static boolean parseBooleanStrict(String trim, ExpressionLogger log)
    • getName

      public String getName()
      Specified by:
      getName in class AbstractSplittingParser