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
Modifier and TypeClassDescriptionstatic enum
Defines the different types of timestamps-functions that are available. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateFunction
Creates a new instance ofDateFunction
for the givenGroupingExpression
.static DayOfMonthFunction
Creates a new instance ofDayOfMonthFunction
for the givenGroupingExpression
.static DayOfWeekFunction
Creates a new instance ofDayOfWeekFunction
for the givenGroupingExpression
.static DayOfYearFunction
Creates a new instance ofDayOfYearFunction
for the givenGroupingExpression
.static HourOfDayFunction
Creates a new instance ofHourOfDayFunction
for the givenGroupingExpression
.static FunctionNode
newInstance
(TimeFunctions.Type type, GroupingExpression exp) Creates a new timestamp-function of the specified type for the givenGroupingExpression
.static MinuteOfHourFunction
Creates a new instance ofMinuteOfHourFunction
for the givenGroupingExpression
.static MonthOfYearFunction
Creates a new instance ofMonthOfYearFunction
for the givenGroupingExpression
.static SecondOfMinuteFunction
Creates a new instance ofSecondOfMinuteFunction
for the givenGroupingExpression
.static YearFunction
Creates a new instance ofYearFunction
for 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 ofDateFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDayOfMonth
Creates a new instance ofDayOfMonthFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDayOfWeek
Creates a new instance ofDayOfWeekFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newDayOfYear
Creates a new instance ofDayOfYearFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newHourOfDay
Creates a new instance ofHourOfDayFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newMinuteOfHour
Creates a new instance ofMinuteOfHourFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newMonthOfYear
Creates a new instance ofMonthOfYearFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newSecondOfMinute
Creates a new instance ofSecondOfMinuteFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
newYear
Creates a new instance ofYearFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-