Class ComparisonCondition


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

      • ComparisonCondition

        public ComparisonCondition​(java.lang.String lhs,
                                   double rhs,
                                   java.lang.String ift,
                                   java.lang.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 Detail

      • getConstant

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

        public java.lang.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