Lines Matching defs:Calendar

61  * The <code>Calendar</code> class is an abstract class that provides methods
75 * Like other locale-sensitive classes, <code>Calendar</code> provides a
77 * object of this type. <code>Calendar</code>'s <code>getInstance</code> method
78 * returns a <code>Calendar</code> object whose
82 * Calendar rightNow = Calendar.getInstance();
86 * <p>A <code>Calendar</code> object can produce all the calendar field values
89 * <code>Calendar</code> defines the range of values returned by
96 * <h4>Getting and Setting Calendar Field Values</h4>
99 * methods. Any field values set in a <code>Calendar</code> will not be
107 * <p><code>Calendar</code> has two modes for interpreting the calendar
109 * <code>Calendar</code> is in lenient mode, it accepts a wider range of
110 * calendar field values than it produces. When a <code>Calendar</code>
116 * <p>When a <code>Calendar</code> is in non-lenient mode, it throws an
126 * <code>Calendar</code> defines a locale-specific seven day week using two
129 * <code>Calendar</code> is constructed. They may also be specified explicitly
133 * <code>WEEK_OF_YEAR</code> fields, <code>Calendar</code> must determine the
140 * different. For example, a specific <code>Calendar</code> subclass may
144 * <h4>Calendar Fields Resolution</h4>
150 * 1996 is actually a Monday). <code>Calendar</code> will resolve
155 * <code>Calendar</code> gives priorities to calendar fields that have been set
178 * field combination, <code>Calendar</code> uses their default values. The default
226 * originally set to August 31, 1999. Calling <code>set(Calendar.MONTH,
227 * Calendar.SEPTEMBER)</code> sets the date to September 31,
230 * call to <code>set(Calendar.DAY_OF_MONTH, 30)</code> before the call to
263 * originally set to August 31, 1999. Calling <code>add(Calendar.MONTH,
310 public abstract class Calendar implements Serializable, Cloneable, Comparable<Calendar> {
312 // Data flow in Calendar
315 // The current time is represented in two ways by Calendar: as UTC
319 // conversion is encapsulated by a TimeZone object owned by the Calendar.
326 // This is implemented by the Calendar subclass's computeTime() method.
333 // | Using Calendar-specific algorithm
342 // the data flow is as follows. This is implemented by the Calendar
351 // | Using Calendar-specific algorithm
359 // the Calendar is lenient, the fields are also renormalized to standard
549 * zone of this <code>Calendar</code> if the
560 * the time zone of this <code>Calendar</code> if the
737 // Calendar contains two kinds of time representations: current "time" in
813 * The <code>TimeZone</code> used by this calendar. <code>Calendar</code>
933 * Constructs a Calendar with the default time zone
937 protected Calendar()
949 protected Calendar(TimeZone zone, Locale aLocale)
961 * <code>Calendar</code> returned is based on the current time
964 * @return a Calendar.
966 public static Calendar getInstance()
968 Calendar cal = createCalendar(TimeZone.getDefaultRef(), Locale.getDefault(Locale.Category.FORMAT));
975 * The <code>Calendar</code> returned is based on the current time
979 * @return a Calendar.
981 public static Calendar getInstance(TimeZone zone)
988 * The <code>Calendar</code> returned is based on the current time
992 * @return a Calendar.
994 public static Calendar getInstance(Locale aLocale)
996 Calendar cal = createCalendar(TimeZone.getDefaultRef(), aLocale);
1003 * The <code>Calendar</code> returned is based on the current time
1008 * @return a Calendar.
1010 public static Calendar getInstance(TimeZone zone,
1016 private static Calendar createCalendar(TimeZone zone,
1019 Calendar cal = null;
1023 // Calendar type is not specified.
1052 * <code>Calendar</code> instances are available.
1083 * <code>Calendar</code>'s time value (millisecond offset from the <a
1095 * Sets this Calendar's time with the given <code>Date</code>.
1110 * Returns this Calendar's time value in milliseconds.
1124 * Sets this Calendar's current time from the given long value.
1182 * <code>Calendar</code> instance.
1306 * this <code>Calendar</code> undefined. This means that {@link
1310 * <code>Calendar</code> implementation class may use its specific
1330 * this <code>Calendar</code> undefined. This means that {@link
1333 * had never been set. A <code>Calendar</code> implementation
1341 * the hour of day value of this <code>Calendar</code>. Use {@link
1342 * #set(int,int) set(Calendar.HOUR_OF_DAY, 0)} to reset the hour
1376 * {@link Calendar#get(int) get(field)} to get the calendar
1380 * <p>For example, if this <code>Calendar</code> is a
1406 * or if this <code>Calendar</code> is non-lenient and any
1433 * example, if this <code>Calendar</code> is a {@link
1440 * this <code>Calendar</code> is a lunisolar calendar system and
1466 * or if this <code>Calendar</code> is non-lenient and any
1637 * <code>Calendar</code> becomes that all the calendar fields are in sync
1682 * Marks this Calendar as not sync'd.
1882 * Compares this <code>Calendar</code> to the specified
1884 * the argument is a <code>Calendar</code> object of the same calendar
1887 * <code>Calendar</code> parameters as this object.
1889 * <p>The <code>Calendar</code> parameters are the values represented
1893 * between the two <code>Calendar</code>s, this method returns
1896 * <p>Use the {@link #compareTo(Calendar) compareTo} method to
1907 Calendar that = (Calendar)obj;
1938 * Returns whether this <code>Calendar</code> represents a time
1944 * if and only if <code>when</code> is a <code>Calendar</code>
1949 * <code>Calendar</code> is before the time represented by
1951 * @see #compareTo(Calendar)
1954 return when instanceof Calendar
1955 && compareTo((Calendar)when) < 0;
1959 * Returns whether this <code>Calendar</code> represents a time
1965 * if and only if <code>when</code> is a <code>Calendar</code>
1969 * @return <code>true</code> if the time of this <code>Calendar</code> is
1972 * @see #compareTo(Calendar)
1975 return when instanceof Calendar
1976 && compareTo((Calendar)when) > 0;
1982 * <code>Calendar</code> objects.
1984 * @param anotherCalendar the <code>Calendar</code> to be compared.
1986 * is equal to the time represented by this <code>Calendar</code>; a value
1987 * less than <code>0</code> if the time of this <code>Calendar</code> is
1989 * <code>0</code> if the time of this <code>Calendar</code> is after the
1991 * @exception NullPointerException if the specified <code>Calendar</code> is
1994 * specified <code>Calendar</code> object can't be obtained due to
1998 public int compareTo(Calendar anotherCalendar) {
2006 * <p><code>add(Calendar.DAY_OF_MONTH, -5)</code>.
2019 * <p>roll(Calendar.DATE, true).
2020 * When rolling on the year or Calendar.YEAR field, it will roll the year
2022 * <code>getMaximum(Calendar.YEAR)</code>.
2023 * When rolling on the month or Calendar.MONTH field, other fields like
2026 * When rolling on the hour-in-day or Calendar.HOUR_OF_DAY field, it will
2032 * @see Calendar#add(int,int)
2033 * @see Calendar#set(int,int)
2042 * <p>NOTE: This default implementation on <code>Calendar</code> just repeatedly calls the
2096 // If the TimeZone object is shared by other Calendar instances, then
2213 * Returns whether this {@code Calendar} supports week dates.
2217 * @return {@code true} if this {@code Calendar} supports week dates;
2229 * Returns the week year represented by this {@code Calendar}. The
2237 * @return the week year of this {@code Calendar}
2240 * in this {@code Calendar}.
2251 * Sets the date of this {@code Calendar} with the the given date
2276 * {@code Calendar}.
2288 * {@code Calendar}.
2296 * {@code Calendar}.
2309 * <code>Calendar</code> instance. The minimum value is defined as
2326 * <code>Calendar</code> instance. The maximum value is defined as
2343 * of this <code>Calendar</code> instance. The highest minimum
2361 * of this <code>Calendar</code> instance. The lowest maximum
2365 * the instance. For example, a <code>Calendar</code> for the
2383 * could have, given the time value of this <code>Calendar</code>.
2393 * value of this <code>Calendar</code>
2412 Calendar work = (Calendar)this.clone();
2436 * <code>Calendar</code>. For example, the actual maximum value of
2447 * value of this <code>Calendar</code>
2466 Calendar work = (Calendar)this.clone();
2500 Calendar other = (Calendar) super.clone();
2582 * a given locale. These must be set when a Calendar is constructed.
2617 private static final long getMillisOf(Calendar calendar) {
2621 Calendar cal = (Calendar) calendar.clone();
2675 Calendar cal = (Calendar) clone();
2698 * Ideally, <code>Calendar</code> would only write out its state data and
2720 // If this Calendar has a ZoneInfo, save it and set a