This project has retired. For details please refer to its Attic page.
DateUtil (Lens 2.0.1-beta-incubating API)

org.apache.lens.cube.parse
Class DateUtil

java.lang.Object
  extended by org.apache.lens.cube.parse.DateUtil

public class DateUtil
extends Object


Field Summary
static String ABSDATE_FMT
           
static SimpleDateFormat ABSDATE_PARSER
           
static String DAY_FMT
           
static String GRANULARITY
           
static String HOUR_FMT
           
static org.apache.log4j.Logger LOG
           
static String MINUTE_FMT
           
static String MONTH_FMT
           
static Pattern P_QUANTITY
           
static Pattern P_RELATIVE
           
static Pattern P_SIGNAGE
           
static Pattern P_UNIT
           
static Pattern P_WSPACE
           
static String QUANTITY
           
static String RELATIVE
           
static Pattern RELDATE_VALIDATOR
           
static String RELDATE_VALIDATOR_STR
           
static String SECOND_FMT
           
static String SIGNAGE
           
static String UNIT
           
static String WSPACE
           
static String YEAR_FMT
           
 
Constructor Summary
DateUtil()
           
 
Method Summary
static String formatDate(Date dt)
           
static String getAbsDateFormatString(String str)
           
static Date getCeilDate(Date fromDate, UpdatePeriod interval)
           
static Date getFloorDate(Date toDate, UpdatePeriod interval)
           
static int getMonthsBetween(Date from, Date to)
           
static int getNumberofDaysInMonth(Date date)
           
static int getQuartersBetween(Date from, Date to)
           
static int getWeeksBetween(Date from, Date to)
           
static int getYearsBetween(Date from, Date to)
           
static Date resolveDate(String str, Date now)
           
static Date resolveRelativeDate(String str, Date now)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG

UNIT

public static final String UNIT
See Also:
Constant Field Values

GRANULARITY

public static final String GRANULARITY
See Also:
Constant Field Values

RELATIVE

public static final String RELATIVE
See Also:
Constant Field Values

P_RELATIVE

public static final Pattern P_RELATIVE

WSPACE

public static final String WSPACE
See Also:
Constant Field Values

P_WSPACE

public static final Pattern P_WSPACE

SIGNAGE

public static final String SIGNAGE
See Also:
Constant Field Values

P_SIGNAGE

public static final Pattern P_SIGNAGE

QUANTITY

public static final String QUANTITY
See Also:
Constant Field Values

P_QUANTITY

public static final Pattern P_QUANTITY

P_UNIT

public static final Pattern P_UNIT

RELDATE_VALIDATOR_STR

public static final String RELDATE_VALIDATOR_STR
See Also:
Constant Field Values

RELDATE_VALIDATOR

public static final Pattern RELDATE_VALIDATOR

YEAR_FMT

public static String YEAR_FMT

MONTH_FMT

public static String MONTH_FMT

DAY_FMT

public static String DAY_FMT

HOUR_FMT

public static String HOUR_FMT

MINUTE_FMT

public static String MINUTE_FMT

SECOND_FMT

public static String SECOND_FMT

ABSDATE_FMT

public static final String ABSDATE_FMT
See Also:
Constant Field Values

ABSDATE_PARSER

public static final SimpleDateFormat ABSDATE_PARSER
Constructor Detail

DateUtil

public DateUtil()
Method Detail

formatDate

public static String formatDate(Date dt)

getAbsDateFormatString

public static String getAbsDateFormatString(String str)

resolveDate

public static Date resolveDate(String str,
                               Date now)
                        throws org.apache.hadoop.hive.ql.parse.SemanticException
Throws:
org.apache.hadoop.hive.ql.parse.SemanticException

resolveRelativeDate

public static Date resolveRelativeDate(String str,
                                       Date now)
                                throws org.apache.hadoop.hive.ql.parse.SemanticException
Throws:
org.apache.hadoop.hive.ql.parse.SemanticException

getCeilDate

public static Date getCeilDate(Date fromDate,
                               UpdatePeriod interval)

getFloorDate

public static Date getFloorDate(Date toDate,
                                UpdatePeriod interval)

getNumberofDaysInMonth

public static int getNumberofDaysInMonth(Date date)

getMonthsBetween

public static int getMonthsBetween(Date from,
                                   Date to)

getQuartersBetween

public static int getQuartersBetween(Date from,
                                     Date to)

getYearsBetween

public static int getYearsBetween(Date from,
                                  Date to)

getWeeksBetween

public static int getWeeksBetween(Date from,
                                  Date to)


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.