Class TimeFunctions
java.lang.Object
com.yahoo.search.grouping.request.TimeFunctions
This abstract class is a factory for timestamp functions in a
GroupingExpression. Apart from offering
per-function factory methods, this class also contains a newInstance(com.yahoo.search.grouping.request.TimeFunctions.Type, GroupingExpression) method which is useful for runtime construction of grouping requests.- Author:
- Simon Thoresen Hult
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the different types of timestamps-functions that are available. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DateFunctionCreates a new instance ofDateFunctionfor the givenGroupingExpression.static DayOfMonthFunctionCreates a new instance ofDayOfMonthFunctionfor the givenGroupingExpression.static DayOfWeekFunctionCreates a new instance ofDayOfWeekFunctionfor the givenGroupingExpression.static DayOfYearFunctionCreates a new instance ofDayOfYearFunctionfor the givenGroupingExpression.static HourOfDayFunctionCreates a new instance ofHourOfDayFunctionfor the givenGroupingExpression.static FunctionNodenewInstance(TimeFunctions.Type type, GroupingExpression exp) Creates a new timestamp-function of the specified type for the givenGroupingExpression.static MinuteOfHourFunctionCreates a new instance ofMinuteOfHourFunctionfor the givenGroupingExpression.static MonthOfYearFunctionCreates a new instance ofMonthOfYearFunctionfor the givenGroupingExpression.static SecondOfMinuteFunctionCreates a new instance ofSecondOfMinuteFunctionfor the givenGroupingExpression.static YearFunctionCreates a new instance ofYearFunctionfor the givenGroupingExpression.
-
Constructor Details
-
TimeFunctions
public TimeFunctions()
-
-
Method Details
-
newInstance
Creates a new timestamp-function of the specified type for the givenGroupingExpression.- Parameters:
type- The type of function to create.exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDate
Creates a new instance ofDateFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDayOfMonth
Creates a new instance ofDayOfMonthFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDayOfWeek
Creates a new instance ofDayOfWeekFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDayOfYear
Creates a new instance ofDayOfYearFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newHourOfDay
Creates a new instance ofHourOfDayFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newMinuteOfHour
Creates a new instance ofMinuteOfHourFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newMonthOfYear
Creates a new instance ofMonthOfYearFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newSecondOfMinute
Creates a new instance ofSecondOfMinuteFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newYear
Creates a new instance ofYearFunctionfor the givenGroupingExpression.- Parameters:
exp- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-