Class MathResolver
java.lang.Object
com.yahoo.search.grouping.request.MathResolver
This is a helper class for resolving arithmetic operations over
GroupingExpression
objects. To resolve an
operation simply push operator-expression pairs onto it, before calling resolve()
to retrieve the single
corresponding grouping expression object.- Author:
- Simon Thoresen Hult
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
push
(MathResolver.Type type, GroupingExpression exp) Pushes the given operator-expression pair onto this math resolver.resolve()
Converts the internal list of operator-expression pairs into a corresponding combined grouping expression.toString()
-
Constructor Details
-
MathResolver
public MathResolver()
-
-
Method Details
-
push
Pushes the given operator-expression pair onto this math resolver. Once all pairs have been pushed using this method, callresolve()
to retrieve to combined grouping expression.- Parameters:
type
- The operator that appears before the expression being pushed.exp
- The expression to push.
-
resolve
Converts the internal list of operator-expression pairs into a corresponding combined grouping expression. When this method returns there is no residue of the conversion, and this object can be reused.- Returns:
- The grouping expression corresponding to the pushed arithmetic operations.
-
toString
-