|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Calendar
java.util.GregorianCalendar
public class GregorianCalendar
GregorianCalendar provides the conversion between Dates and integer calendar fields, such as the month, year or minute, for the Gregorian calendar. See Calendar for the defined fields.
Calendar,
TimeZone,
SimpleTimeZone,
Serialized Form| Field Summary | |
|---|---|
static int |
AD
Value for the AD era. |
static int |
BC
Value for the BC era. |
(package private) static byte[] |
DaysInMonth
|
| 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, lastDateFieldSet, lastTimeFieldSet, 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 | |
|---|---|
GregorianCalendar()
Constructs a new GregorianCalendar initialized to the current date and time. |
|
GregorianCalendar(boolean ignored)
|
|
GregorianCalendar(int year,
int month,
int day)
Constructs a new GregorianCalendar initialized to midnight in the default time zone on the specified date. |
|
GregorianCalendar(int year,
int month,
int day,
int hour,
int minute)
Constructs a new GregorianCalendar initialized to the specified date and time. |
|
GregorianCalendar(int year,
int month,
int day,
int hour,
int minute,
int second)
Constructs a new GregorianCalendar initialized to the specified date and time. |
|
GregorianCalendar(Locale locale)
Constructs a new GregorianCalendar initialized to the current date and time and using the specified Locale. |
|
GregorianCalendar(long milliseconds)
|
|
GregorianCalendar(TimeZone timezone)
Constructs a new GregorianCalendar initialized to the current date and time and using the specified TimeZone. |
|
GregorianCalendar(TimeZone timezone,
Locale locale)
Constructs a new GregorianCalendar initialized to the current date and time and using the specified TimeZone and Locale. |
|
| Method Summary | |
|---|---|
void |
add(int field,
int value)
Adds the specified amount to a Calendar field. |
Object |
clone()
Creates new instance of GregorianCalendar with the same properties. |
protected void |
computeFields()
Computes the Calendar fields from the time. |
protected void |
computeTime()
Computes the time from the Calendar fields. |
boolean |
equals(Object object)
Compares the specified object to this GregorianCalendar and answer if they are equal. |
int |
getActualMaximum(int field)
Gets the maximum value of the specified field for the current date. |
int |
getActualMinimum(int field)
Gets the minimum value of the specified field for the current date. |
int |
getGreatestMinimum(int field)
Gets the greatest minimum value of the specified field. |
Date |
getGregorianChange()
Returns the gregorian change date of this calendar. |
int |
getLeastMaximum(int field)
Gets the smallest maximum value of the specified field. |
int |
getMaximum(int field)
Gets the greatest maximum value of the specified field. |
int |
getMinimum(int field)
Gets the smallest minimum value of the specified field. |
(package private) int |
getOffset(long localTime)
|
int |
hashCode()
Returns an integer hash code for the receiver. |
boolean |
isLeapYear(int year)
Returns if the specified year is a leap year. |
void |
roll(int field,
boolean increment)
Increment or decrement the specified field and wrap the value of the field when it goes beyond the maximum or minimum value for the current date. |
void |
roll(int field,
int value)
Adds the specified amount the specified field and wrap the value of the field when it goes beyond the maximum or minimum value for the current date. |
void |
setFirstDayOfWeek(int value)
Sets the first day of the week for this Calendar. |
void |
setGregorianChange(Date date)
Sets the gregorian change date of this calendar. |
void |
setMinimalDaysInFirstWeek(int value)
Sets the minimal days in the first week of the year. |
| Methods inherited from class java.util.Calendar |
|---|
after, before, clear, clear, compareTo, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, internalGet, isLenient, isSet, set, set, set, set, setLenient, setTime, setTimeInMillis, setTimeZone, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int BC
public static final int AD
static byte[] DaysInMonth
| Constructor Detail |
|---|
public GregorianCalendar()
public GregorianCalendar(int year,
int month,
int day)
year - the yearmonth - the monthday - the day of the month
public GregorianCalendar(int year,
int month,
int day,
int hour,
int minute)
year - the yearmonth - the monthday - the day of the monthhour - the hourminute - the minute
public GregorianCalendar(int year,
int month,
int day,
int hour,
int minute,
int second)
year - the yearmonth - the monthday - the day of the monthhour - the hourminute - the minutesecond - the secondGregorianCalendar(long milliseconds)
public GregorianCalendar(Locale locale)
locale - the Localepublic GregorianCalendar(TimeZone timezone)
timezone - the TimeZone
public GregorianCalendar(TimeZone timezone,
Locale locale)
timezone - the TimeZonelocale - the LocaleGregorianCalendar(boolean ignored)
| Method Detail |
|---|
public void add(int field,
int value)
add in class Calendarfield - the Calendar field to modifyvalue - the amount to add to the field
IllegalArgumentException - when the specified field is DST_OFFSET or ZONE_OFFSET.public Object clone()
clone in class CalendarCloneableprotected void computeFields()
computeFields in class Calendarprotected void computeTime()
computeTime in class CalendarIllegalArgumentException - when the time cannot be computed from the current field
valuespublic boolean equals(Object object)
equals in class Calendarobject - the object to compare with this object
IllegalArgumentException - when the time is not set and the time cannot be computed
from the current field valueshashCode()public int getActualMaximum(int field)
getActualMaximum in class Calendarfield - the field
public int getActualMinimum(int field)
getMinimum().
getActualMinimum in class Calendarfield - the field
public int getGreatestMinimum(int field)
getMinimum().
getGreatestMinimum in class Calendarfield - the field
public final Date getGregorianChange()
public int getLeastMaximum(int field)
getLeastMaximum in class Calendarfield - the field
public int getMaximum(int field)
getMaximum in class Calendarfield - the field
public int getMinimum(int field)
getMinimum in class Calendarfield - the field
int getOffset(long localTime)
public int hashCode()
hashCode in class Calendarequals(java.lang.Object)public boolean isLeapYear(int year)
year - the year
public void roll(int field,
int value)
roll in class Calendarfield - the field to rollvalue - the amount to add
IllegalArgumentException - when an invalid field is specified
public void roll(int field,
boolean increment)
roll in class Calendarfield - the field to rollincrement - true to increment the field, false to decrement
IllegalArgumentException - when an invalid field is specifiedpublic void setGregorianChange(Date date)
date - a Date which represents the gregorian change datepublic void setFirstDayOfWeek(int value)
Calendar
setFirstDayOfWeek in class Calendarvalue - a Calendar day of the weekpublic void setMinimalDaysInFirstWeek(int value)
Calendar
setMinimalDaysInFirstWeek in class Calendarvalue - the minimal days in the first week of the year
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||