de.bea.domingo.util
Class GregorianDateTime

java.lang.Object
  extended by java.util.Calendar
      extended by java.util.GregorianCalendar
          extended by de.bea.domingo.util.GregorianDateTime
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Calendar>

public final class GregorianDateTime
extends java.util.GregorianCalendar

A Gregorian calendar with date and time, but without milliseconds.

Author:
Kurt Riede
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.GregorianCalendar
AD, BC
 
Fields inherited from class java.util.Calendar
AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET
 
Constructor Summary
GregorianDateTime()
          Default constructor.
GregorianDateTime(java.util.Calendar calendar)
          Creates a new Gregorian date from a given java.util.Calendar.
GregorianDateTime(java.util.Date date)
          Creates a new Gregorian date from a given java.util.Date.
GregorianDateTime(java.util.Date date, java.util.TimeZone zone)
          Creates a new Gregorian date from a given java.util.Date.
GregorianDateTime(int year, int month, int day)
          Creates a new Gregorian date from given year, month and date.
GregorianDateTime(int year, int month, int day, int hour, int minute, int second)
          Creates a new Gregorian date from given year, month and date.
GregorianDateTime(int year, int month, int day, int hour, int minute, int second, java.util.TimeZone zone)
          Creates a new Gregorian date from given year, month and date.
GregorianDateTime(java.util.TimeZone zone)
          Constructor.
 
Method Summary
protected  void computeTime()
          Overwrites GregorianCalendar.computeTime(), to disable all time fields.
 int getDay()
          Returns the day of the calendar.
 int getHour()
          Returns the hour of the calendar.
 int getMinute()
          Returns the minute of the calendar.
 int getMonth()
          Returns the month of the calendar.
 int getSecond()
          Returns the second of the calendar.
 int getYear()
          Returns the year of the calendar.
 void set(int field, int value)
          Overwrite prevents setting time fields.
 void setTimeZone(java.util.TimeZone zone)
          Overwrite prevents setting a time zone to keep the time unchanged and unavailable.
 java.lang.String toString()
          
 
Methods inherited from class java.util.GregorianCalendar
add, clone, computeFields, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, hashCode, isLeapYear, roll, roll, setGregorianChange
 
Methods inherited from class java.util.Calendar
after, before, clear, clear, compareTo, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GregorianDateTime

public GregorianDateTime()
Default constructor.


GregorianDateTime

public GregorianDateTime(java.util.TimeZone zone)
Constructor.

Parameters:
zone - the given time zone.

GregorianDateTime

public GregorianDateTime(java.util.Date date)
Creates a new Gregorian date from a given java.util.Date.

Parameters:
date - the date for the new calendar

GregorianDateTime

public GregorianDateTime(java.util.Date date,
                         java.util.TimeZone zone)
Creates a new Gregorian date from a given java.util.Date.

Parameters:
date - the date for the new calendar
zone - the given time zone.

GregorianDateTime

public GregorianDateTime(java.util.Calendar calendar)
Creates a new Gregorian date from a given java.util.Calendar.

Parameters:
calendar - the original calendar for the new calendar

GregorianDateTime

public GregorianDateTime(int year,
                         int month,
                         int day)
Creates a new Gregorian date from given year, month and date.

The first month of the year is JANUARY which is 0; the last month is DEDCEMBER which is 11.

Parameters:
year - the year of the new calendar
month - the month of the new calendar
day - the day of the new calendar

GregorianDateTime

public GregorianDateTime(int year,
                         int month,
                         int day,
                         int hour,
                         int minute,
                         int second)
Creates a new Gregorian date from given year, month and date.

The first month of the year is JANUARY which is 0; the last month is DEDCEMBER which is 11.

Parameters:
year - the year of the new calendar
month - the month of the new calendar
day - the day of the new calendar
hour - the hour of the new calendar
minute - the minute of the new calendar
second - the second of the new calendar

GregorianDateTime

public GregorianDateTime(int year,
                         int month,
                         int day,
                         int hour,
                         int minute,
                         int second,
                         java.util.TimeZone zone)
Creates a new Gregorian date from given year, month and date.

The first month of the year is JANUARY which is 0; the last month is DEDCEMBER which is 11.

Parameters:
year - the year of the new calendar
month - the month of the new calendar
day - the day of the new calendar
hour - the hour of the new calendar
minute - the minute of the new calendar
second - the second of the new calendar
zone - the given time zone.
Method Detail

set

public void set(int field,
                int value)
Overwrite prevents setting time fields.

Overrides:
set in class java.util.Calendar
Parameters:
field - the given calendar field.
value - the value to be set for the given calendar field.
See Also:
Calendar.set(int, int)

setTimeZone

public void setTimeZone(java.util.TimeZone zone)
Overwrite prevents setting a time zone to keep the time unchanged and unavailable.

Overrides:
setTimeZone in class java.util.GregorianCalendar
Parameters:
zone - the new time zone (ignored)
See Also:
Calendar.setTimeZone(java.util.TimeZone)

computeTime

protected void computeTime()
Overwrites GregorianCalendar.computeTime(), to disable all time fields.

Overrides:
computeTime in class java.util.GregorianCalendar
See Also:
Calendar.computeTime()

getMonth

public int getMonth()
Returns the month of the calendar.

Returns:
the month

getDay

public int getDay()
Returns the day of the calendar.

Returns:
the day

getYear

public int getYear()
Returns the year of the calendar.

Returns:
the year

getHour

public int getHour()
Returns the hour of the calendar.

Returns:
the hour

getMinute

public int getMinute()
Returns the minute of the calendar.

Returns:
the minute

getSecond

public int getSecond()
Returns the second of the calendar.

Returns:
the second

toString

public java.lang.String toString()

Overrides:
toString in class java.util.Calendar
See Also:
Calendar.toString()


Domingo Java-API