Save This Page
Home » openjdk-7 » sun » util » calendar » [javadoc | source]
abstract public class: CalendarDate [javadoc | source]

All Implemented Interfaces:

Direct Known Subclasses:
    Date, Date, Date, ImmutableGregorianDate, Date

The CalendarDate class represents a specific instant in time by calendar date and time fields that are multiple cycles in different time unites. The semantics of each calendar field is given by a concrete calendar system rather than this CalendarDate class that holds calendar field values without interpreting them. Therefore, this class can be used to represent an amount of time, such as 2 years and 3 months.

A CalendarDate instance can be created by calling the newCalendarDate or getCalendarDate methods in CalendarSystem. A CalendarSystem instance is obtained by calling one of the factory methods in CalendarSystem. Manipulations of calendar dates must be handled by the calendar system by which CalendarDate instances have been created.

Some calendar fields can be modified through method calls. Any modification of a calendar field brings the state of a CalendarDate to not normalized. The normalization must be performed to make all the calendar fields consistent with a calendar system.

The protected methods are intended to be used for implementing a concrete calendar system, not for general use as an API.

Field Summary
public static final  int FIELD_UNDEFINED     
public static final  long TIME_UNDEFINED     
 protected CalendarDate() 
 protected CalendarDate(TimeZone zone) 
Method from sun.util.calendar.CalendarDate Summary:
addDate,   addDayOfMonth,   addHours,   addMillis,   addMinutes,   addMonth,   addSeconds,   addTimeOfDay,   addYear,   clone,   equals,   getDayOfMonth,   getDayOfWeek,   getDaylightSaving,   getEra,   getHours,   getMillis,   getMinutes,   getMonth,   getSeconds,   getTimeOfDay,   getYear,   getZone,   getZoneOffset,   hashCode,   isDaylightTime,   isLeapYear,   isNormalized,   isSameDate,   isStandardTime,   setDate,   setDayOfMonth,   setDayOfWeek,   setDaylightSaving,   setEra,   setHours,   setLeapYear,   setLocale,   setMillis,   setMinutes,   setMonth,   setNormalized,   setSeconds,   setStandardTime,   setTimeOfDay,   setTimeOfDay,   setYear,   setZone,   setZoneOffset,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.util.calendar.CalendarDate Detail:
 public CalendarDate addDate(int year,
    int month,
    int dayOfMonth) 
 public CalendarDate addDayOfMonth(int n) 
 public CalendarDate addHours(int n) 
 public CalendarDate addMillis(int n) 
 public CalendarDate addMinutes(int n) 
 public CalendarDate addMonth(int n) 
 public CalendarDate addSeconds(int n) 
 public CalendarDate addTimeOfDay(int hours,
    int minutes,
    int seconds,
    int millis) 
 public CalendarDate addYear(int n) 
 public Object clone() 
    Returns a copy of this CalendarDate. The TimeZone object, if any, is not cloned.
 public boolean equals(Object obj) 
 public int getDayOfMonth() 
 public int getDayOfWeek() 
    Returns the day of week value. If this CalendarDate is not normalized, #FIELD_UNDEFINED is returned.
 public int getDaylightSaving() 
 public Era getEra() 
 public int getHours() 
 public int getMillis() 
 public int getMinutes() 
 public int getMonth() 
 public int getSeconds() 
 public long getTimeOfDay() 
 public int getYear() 
 public TimeZone getZone() 
 public int getZoneOffset() 
 public int hashCode() 
 public boolean isDaylightTime() 
 public boolean isLeapYear() 
    Returns whether the year represented by this CalendarDate is a leap year. If leap years are not applicable to the calendar system, this method always returns false.

    If this CalendarDate hasn't been normalized, false is returned. The normalization must be performed to retrieve the correct leap year information.

 public boolean isNormalized() 
 public boolean isSameDate(CalendarDate date) 
    Returns whether the specified date is the same date of this CalendarDate. The time of the day fields are ignored for the comparison.
 public boolean isStandardTime() 
 public CalendarDate setDate(int year,
    int month,
    int dayOfMonth) 
 public CalendarDate setDayOfMonth(int date) 
 protected  void setDayOfWeek(int dayOfWeek) 
 protected  void setDaylightSaving(int daylightSaving) 
 public CalendarDate setEra(Era era) 
    Sets the era of the date to the specified era. The default implementation of this method accepts any Era value, including null.
 public CalendarDate setHours(int hours) 
  void setLeapYear(boolean leapYear) 
 protected  void setLocale(Locale loc) 
 public CalendarDate setMillis(int millis) 
 public CalendarDate setMinutes(int minutes) 
 public CalendarDate setMonth(int month) 
 protected  void setNormalized(boolean normalized) 
 public CalendarDate setSeconds(int seconds) 
 public  void setStandardTime(boolean standardTime) 
 protected  void setTimeOfDay(long fraction) 
 public CalendarDate setTimeOfDay(int hours,
    int minutes,
    int seconds,
    int millis) 
 public CalendarDate setYear(int year) 
 public CalendarDate setZone(TimeZone zoneinfo) 
 protected  void setZoneOffset(int offset) 
 public String toString() 
    Converts calendar date values to a String in the following format.