|
|||||||||
| Home >> All >> org >> chiba >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.chiba.util
Class DateUtil

java.lang.Objectorg.chiba.util.DateUtil
- public abstract class DateUtil
- extends java.lang.Object
This abstract class is responsible for calculations on and with Dates, for transformation of these to Strings vice versa. Main focus of calculations are Startdates(especially Startdates of calendarweeks). Additionally it extracts from a String that represents a Date only the day, the month and the year. It also gets the calendarweek.
- Version:
- $Revision: 1.3 $
| Constructor Summary | |
DateUtil()
|
|
| Method Summary | |
static java.lang.String |
format(java.util.Date d,
java.util.Locale locale)
This method formats a Date to a String |
static java.lang.String |
format(java.util.Date d,
java.util.Locale locale,
int style)
|
static java.lang.String |
format(java.lang.String day,
java.lang.String month,
java.lang.String year,
java.util.Locale locale)
this method parses the @params String day,month,year to ints, builds a Gregorian Calendar with these values to get the corresponding Date that is returned as String by invoking the method format(Date d,Locale locale), that used to parse a Date to a String. |
static java.lang.String |
getDate()
Returns the current date and time correctly formated |
static java.lang.String |
getDate(java.util.Locale locale)
gets the current Date and returns it as String |
static java.lang.String |
getDate(java.util.Locale locale,
int style)
same as above but allows to specify a DateFormat-style.15.06.2001 00:07 |
static java.lang.String |
getDateIfEmpty(java.lang.String first)
get the current date and returns it as formated string in the current locale if (and only if) the parameter first is empty or the empty string. |
static java.lang.String |
getDay(java.lang.String tempdat,
java.util.Locale locale)
This method parses the @param String tempdat, according to a specified format style determined by the @param Locale locale to a Date. |
static java.lang.String |
getMonth(java.lang.String tempdat,
java.util.Locale locale)
This method parses the @param String tempdat, according to a specified format style determined by the @param Locale locale to a Date. |
static java.lang.String |
getStartDate(java.util.Date date,
int weeks,
java.util.Locale locale)
This method receives the @params Date date,int weeks,Locale locale It sets a Gregorian Calendar with the given Date, with the given locale a format style is determined. |
private static java.lang.String |
getStartDateOfWeek(java.util.Date selectedDate,
java.util.Locale locale)
This method sets a Gregorian Calendar according to the given Date |
static int |
getTime()
|
static int |
getWeek(int duration)
This method subtracts the @param int duration that represents the weeks that past from the current week, and obtains the corresponding week of year. |
static java.lang.String |
getYear(java.lang.String tempdat,
java.util.Locale locale)
This method parses the @param String tempdat, according to a specified format style determined by the @param Locale locale to a Date. |
static java.util.Date |
toDate(java.lang.String dateString,
java.util.Locale locale)
This method parses a @param String dateString to a Date |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
DateUtil
public DateUtil()
| Method Detail |
getDay
public static java.lang.String getDay(java.lang.String tempdat, java.util.Locale locale)
- This method parses the @param String tempdat, according to a specified format style
determined by the @param Locale locale to a Date. It sets a Gregorian Calender
with this date and gets the value of the day.
Needed for StringDate Constructor
getMonth
public static java.lang.String getMonth(java.lang.String tempdat, java.util.Locale locale)
- This method parses the @param String tempdat, according to a specified format style
determined by the @param Locale locale to a Date. It sets a Gregorian Calender
with this date and gets the value of the month.
Needed for StringDate Constructor
getYear
public static java.lang.String getYear(java.lang.String tempdat, java.util.Locale locale)
- This method parses the @param String tempdat, according to a specified format style
determined by the @param Locale locale to a Date. It sets a Gregorian Calender
with this date and gets the value of the year.
Needed for StringDate Constructor
getDate
public static java.lang.String getDate(java.util.Locale locale)
- gets the current Date and returns it as String
getDate
public static java.lang.String getDate(java.util.Locale locale, int style)
- same as above but allows to specify a DateFormat-style.15.06.2001 00:07
getStartDate
public static java.lang.String getStartDate(java.util.Date date, int weeks, java.util.Locale locale)
- This method receives the @params Date date,int weeks,Locale locale
It sets a Gregorian Calendar with the given Date, with the given locale
a format style is determined. By using the @param weeks that specifies the amount
of weeks that past, the corresponding week of year is calculated. Based on this value
the method getStartDateOfWeek is invoked.
getStartDateOfWeek is responsible for calculating the date of the first day of a
week of year.
getWeek
public static int getWeek(int duration)
- This method subtracts the @param int duration that represents the weeks that past
from the current week, and obtains the corresponding week of year.
getStartDateOfWeek
private static java.lang.String getStartDateOfWeek(java.util.Date selectedDate, java.util.Locale locale)
- This method sets a Gregorian Calendar according to the given Date
format
public static java.lang.String format(java.util.Date d, java.util.Locale locale)
- This method formats a Date to a String
format
public static java.lang.String format(java.util.Date d, java.util.Locale locale, int style)
format
public static java.lang.String format(java.lang.String day, java.lang.String month, java.lang.String year, java.util.Locale locale)
- this method parses the @params String day,month,year to ints, builds a Gregorian
Calendar with these values to get the corresponding Date that is returned as
String by invoking the method format(Date d,Locale locale), that used to parse a
Date to a String.
toDate
public static java.util.Date toDate(java.lang.String dateString, java.util.Locale locale)
- This method parses a @param String dateString to a Date
getTime
public static int getTime()
getDate
public static java.lang.String getDate()
- Returns the current date and time correctly formated
getDateIfEmpty
public static java.lang.String getDateIfEmpty(java.lang.String first)
- get the current date and returns it as formated string in the
current locale if (and only if) the parameter first is empty or the
empty string.
|
|||||||||
| Home >> All >> org >> chiba >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.chiba.util.DateUtil