Class TimeFunctions
- java.lang.Object
-
- com.yahoo.search.grouping.request.TimeFunctions
-
public abstract class TimeFunctions extends java.lang.Object
This abstract class is a factory for timestamp functions in aGroupingExpression
. Apart from offering per-function factory methods, this class also contains anewInstance(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 Classes Modifier and Type Class Description static class
TimeFunctions.Type
Defines the different types of timestamps-functions that are available.
-
Constructor Summary
Constructors Constructor Description TimeFunctions()
-
Method Summary
-
-
-
Method Detail
-
newInstance
public static FunctionNode newInstance(TimeFunctions.Type type, GroupingExpression exp)
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
public static DateFunction newDate(GroupingExpression exp)
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
public static DayOfMonthFunction newDayOfMonth(GroupingExpression exp)
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
public static DayOfWeekFunction newDayOfWeek(GroupingExpression exp)
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
public static DayOfYearFunction newDayOfYear(GroupingExpression exp)
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
public static HourOfDayFunction newHourOfDay(GroupingExpression exp)
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
public static MinuteOfHourFunction newMinuteOfHour(GroupingExpression exp)
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
public static MonthOfYearFunction newMonthOfYear(GroupingExpression exp)
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
public static SecondOfMinuteFunction newSecondOfMinute(GroupingExpression exp)
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
public static YearFunction newYear(GroupingExpression exp)
Creates a new instance ofYearFunction
for the givenGroupingExpression
.- Parameters:
exp
- The expression to evaluate, must evaluate to a long.- Returns:
- The created function node.
-
-