Package com.yahoo.searchlib.treenet.rule
Class ComparisonCondition
- java.lang.Object
-
- com.yahoo.searchlib.treenet.rule.TreeNode
-
- com.yahoo.searchlib.treenet.rule.Condition
-
- com.yahoo.searchlib.treenet.rule.ComparisonCondition
-
public class ComparisonCondition extends Condition
Represents a condition which comparing two values- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description ComparisonCondition(String lhs, double rhs, String ift, String iff)
Constructs a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
conditionToRankingExpression()
Returns the ranking expression string for the condition part of this condition, i.e the ...double
getConstant()
Returns the constant to compare the feature with.-
Methods inherited from class com.yahoo.searchlib.treenet.rule.Condition
getFalseLabel, getLeftValue, getTrueLabel, toRankingExpression
-
-
-
-
Constructor Detail
-
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 Detail
-
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 ofif(leftValue ..., trueExpression, falseExpression)
- Specified by:
conditionToRankingExpression
in classCondition
-
-