Class ComparisonCondition


public class ComparisonCondition extends Condition
Represents a condition which comparing two values
Author:
Simon Thoresen Hult
  • Constructor Details

    • ComparisonCondition

      public ComparisonCondition(String lhs, double rhs, String ift, String iff)
      Constructs a new instance of this class.
      Parameters:
      lhs - The name of the feature to compare to a constant.
      rhs - The constant to compare the feature with.
      ift - The label to jump to if left < right.
      iff - The label to jump to if left >= right;
  • Method Details

    • getConstant

      public double getConstant()
      Returns the constant to compare the feature with.
      Returns:
      The constant.
    • conditionToRankingExpression

      public String conditionToRankingExpression()
      Description copied from class: Condition
      Returns the ranking expression string for the condition part of this condition, i.e the ... part of
           if(leftValue ..., trueExpression, falseExpression)
       
      Specified by:
      conditionToRankingExpression in class Condition