ICU-2103 tag cleanup

X-SVN-Rev: 10469
This commit is contained in:
Doug Felt 2002-12-04 01:03:39 +00:00
parent 2f79227b38
commit 5ddc0755aa
17 changed files with 464 additions and 127 deletions

View file

@ -632,7 +632,7 @@ import java.util.Set;
* @see GregorianCalendar
* @see TimeZone
* @see DateFormat
* @version $Revision: 1.34 $ $Date: 2002/11/17 01:42:15 $
* @version $Revision: 1.35 $ $Date: 2002/12/04 01:03:39 $
* @author Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu, Laura Werner
* @since JDK1.1
*/
@ -1512,12 +1512,14 @@ public abstract class Calendar implements Serializable, Cloneable {
private static Map getFactoryMap() {
if (factoryMap == null) {
Map m = new HashMap(5);
/*
addFactory(m, BuddhistCalendar.factory());
addFactory(m, ChineseCalendar.factory());
addFactory(m, GregorianCalendar.factory());
addFactory(m, HebrewCalendar.factory());
addFactory(m, IslamicCalendar.factory());
addFactory(m, JapaneseCalendar.factory());
*/
factoryMap = m;
}
return factoryMap;
@ -1587,14 +1589,14 @@ public abstract class Calendar implements Serializable, Cloneable {
private static ICULocaleService getService() {
if (service == null) {
ICULocaleService newService = new ICULocaleService("Calendar");
/*
class RBCalendarFactory extends ICUResourceBundleFactory {
protected Object handleCreate(Locale locale, int kind, ICUService service) {
return GregorianCalendar.factory();
}
}
newService.registerFactory(new RBCalendarFactory());
*/
synchronized (Calendar.class) {
if (service == null) {
service = newService;

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/CalendarAstronomer.java,v $
* $Date: 2002/11/22 22:45:19 $
* $Revision: 1.7 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.8 $
*
*****************************************************************************************
*/
@ -1057,6 +1057,7 @@ public class CalendarAstronomer {
*
* @see CalendarAstronomer.Equatorial
* @see CalendarAstronomer.Horizon
* @stable
*/
public static final class Ecliptic {
/**

View file

@ -5,15 +5,21 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/CalendarCache.java,v $
* $Date: 2002/02/16 03:06:26 $
* $Revision: 1.4 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.5 $
*
*****************************************************************************************
*/
package com.ibm.icu.util;
/**
* @internal
*/
public class CalendarCache
{
/**
* @internal
*/
public CalendarCache() {
makeArrays(arraySize);
}
@ -30,10 +36,16 @@ public class CalendarCache
size = 0;
}
/**
* @internal
*/
public synchronized long get(long key) {
return values[findIndex(key)];
}
/**
* @internal
*/
public synchronized void put(long key, long value)
{
if (size >= threshold) {

View file

@ -3,8 +3,8 @@
* others. All Rights Reserved.
*********************************************************************
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/ChineseCalendar.java,v $
* $Date: 2002/10/02 20:20:25 $
* $Revision: 1.11 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.12 $
*/
package com.ibm.icu.util;
import com.ibm.icu.lang.*;
@ -70,6 +70,7 @@ import java.util.Locale;
* </ul>
* @see com.ibm.icu.text.ChineseDateFormat
* @author Alan Liu
* @stable
*/
public class ChineseCalendar extends Calendar {
@ -121,6 +122,7 @@ public class ChineseCalendar extends Calendar {
/**
* Construct a Chinese calendar with the default time zone and locale.
* @stable
*/
public ChineseCalendar() {
super();
@ -130,6 +132,7 @@ public class ChineseCalendar extends Calendar {
* Construct a Chinese calendar with the given time zone and locale.
* @param zone time zone for this calendar
* @param locale locale for this calendar
* @stable
*/
public ChineseCalendar(TimeZone zone, Locale locale) {
super(zone, locale);
@ -142,6 +145,7 @@ public class ChineseCalendar extends Calendar {
/**
* Field indicating whether or not the current month is a leap month.
* Should have a value of 0 for non-leap months, and 1 for leap months.
* @stable
*/
public static int IS_LEAP_MONTH = BASE_FIELD_COUNT;
@ -156,6 +160,7 @@ public class ChineseCalendar extends Calendar {
/**
* Override Calendar to allocate our additional field.
* @stable
*/
protected int[] handleCreateFields() {
return new int[FIELD_COUNT];
@ -227,6 +232,7 @@ public class ChineseCalendar extends Calendar {
/**
* Override Calendar to return the limit value for the given field.
* @stable
*/
protected int handleGetLimit(int field, int limitType) {
return LIMITS[field][limitType];
@ -237,6 +243,7 @@ public class ChineseCalendar extends Calendar {
* defined by the current fields. This will use either the ERA and
* YEAR field as the cycle and year-of-cycle, or the EXTENDED_YEAR
* field as the continuous year count, depending on which is newer.
* @stable
*/
protected int handleGetExtendedYear() {
int year;
@ -255,6 +262,7 @@ public class ChineseCalendar extends Calendar {
*
* <p>Note: This method also reads the IS_LEAP_MONTH field to determine
* whether or not the given month is a leap month.
* @stable
*/
protected int handleGetMonthLength(int extendedYear, int month) {
int thisStart = handleComputeMonthStart(extendedYear, month, true) -
@ -268,6 +276,7 @@ public class ChineseCalendar extends Calendar {
* using the the given pattern. This method is responsible for
* creating the calendar- specific DateFormat and DateFormatSymbols
* objects as needed.
* @stable
*/
protected DateFormat handleGetDateFormat(String pattern, Locale locale) {
return new ChineseDateFormat(pattern, locale);
@ -300,6 +309,7 @@ public class ChineseCalendar extends Calendar {
/**
* Override Calendar to add IS_LEAP_MONTH to the field resolution
* table.
* @stable
*/
protected int[][][] getFieldResolutionTable() {
return CHINESE_DATE_PRECEDENCE;
@ -345,6 +355,7 @@ public class ChineseCalendar extends Calendar {
/**
* Override Calendar to handle leap months properly.
* @stable
*/
public void add(int field, int amount) {
switch (field) {
@ -364,6 +375,7 @@ public class ChineseCalendar extends Calendar {
/**
* Override Calendar to handle leap months properly.
* @stable
*/
public void roll(int field, int amount) {
switch (field) {
@ -604,6 +616,7 @@ public class ChineseCalendar extends Calendar {
* calendar equivalents for the given Julian day.
*
* <p>Compute the ChineseCalendar-specific field IS_LEAP_MONTH.
* @stable
*/
protected void handleComputeFields(int julianDay) {
@ -744,6 +757,7 @@ public class ChineseCalendar extends Calendar {
* by reading the IS_LEAP_MONTH field.
* @param return the Julian day number of the day before the first
* day of the given month and year
* @stable
*/
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
@ -786,6 +800,8 @@ public class ChineseCalendar extends Calendar {
return julianDay - 1;
}
/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
if (factory == null) {
@ -801,4 +817,5 @@ public class ChineseCalendar extends Calendar {
}
return factory;
}
*/
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Currency.java,v $
* $Date: 2002/11/16 03:46:35 $
* $Revision: 1.9 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.10 $
*
*******************************************************************************
*/
@ -43,7 +43,7 @@ import com.ibm.icu.impl.ICULocaleService.ICUResourceBundleFactory;
* <tt>java.util.Currency</tt> but it has a completely independent
* implementation, and adds features not present in the JDK.
* @author Alan Liu
* @since ICU 2.2
* @draft ICU 2.2
*/
public class Currency implements Serializable {
@ -82,6 +82,7 @@ public class Currency implements Serializable {
/**
* Returns a currency object for the default currency in the given
* locale.
* @draft ICU 2.2
*/
public static Currency getInstance(Locale locale) {
return (Currency)getService().get(locale);
@ -89,6 +90,7 @@ public class Currency implements Serializable {
/**
* Returns a currency object given an ISO 4217 3-letter code.
* @draft ICU 2.2
*/
public static Currency getInstance(String theISOCode) {
return new Currency(theISOCode);
@ -115,6 +117,7 @@ public class Currency implements Serializable {
/**
* Return an array of the locales for which a currency
* is defined.
* @draft ICU 2.2
*/
public static Locale[] getAvailableLocales() {
if (service == null) {
@ -128,6 +131,7 @@ public class Currency implements Serializable {
/**
* Return a hashcode for this currency.
* @draft ICU 2.2
*/
public int hashCode() {
return isoCode.hashCode();
@ -136,6 +140,7 @@ public class Currency implements Serializable {
/**
* Return true if rhs is a Currency instance,
* is non-null, and has the same currency code.
* @draft ICU 2.2
*/
public boolean equals(Object rhs) {
try {
@ -148,6 +153,7 @@ public class Currency implements Serializable {
/**
* Return true if c is non-null and has the same currency code.
* @draft ICU 2.2
*/
public boolean equals(Currency c) {
if (c == null) return false;
@ -158,6 +164,7 @@ public class Currency implements Serializable {
/**
* Returns the ISO 4217 3-letter code for this currency object.
* @draft ICU 2.2
*/
public String getCurrencyCode() {
return isoCode;
@ -167,6 +174,7 @@ public class Currency implements Serializable {
* Returns the display string for this currency object in the
* given locale. For example, the display string for the USD
* currency object in the en_US locale is "$".
* @draft ICU 2.2
*/
public String getSymbol(Locale locale) {
// Look up the Currencies resource for the given locale. The
@ -212,6 +220,7 @@ public class Currency implements Serializable {
* be displayed for this currency.
* @return a non-negative number of fraction digits to be
* displayed
* @draft ICU 2.2
*/
public int getDefaultFractionDigits() {
return (findData())[0].intValue();
@ -221,6 +230,7 @@ public class Currency implements Serializable {
* Returns the rounding increment for this currency, or 0.0 if no
* rounding is done by this currency.
* @return the non-negative rounding increment, or 0.0 if none
* @draft ICU 2.2
*/
public double getRoundingIncrement() {
Integer[] data = findData();
@ -247,6 +257,7 @@ public class Currency implements Serializable {
/**
* Returns the ISO 4217 code for this currency.
* @draft ICU 2.2
*/
public String toString() {
return isoCode;

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/EasterHoliday.java,v $
* $Date: 2002/02/16 03:06:27 $
* $Revision: 1.6 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.7 $
*
*****************************************************************************************
*/
@ -22,7 +22,7 @@ import com.ibm.icu.util.SimpleTimeZone;
* A Holiday subclass which represents holidays that occur
* a fixed number of days before or after Easter. Supports both the
* Western and Orthodox methods for calculating Easter.
*
* @draft ICU 2.2
*/
public class EasterHoliday extends Holiday
{
@ -30,6 +30,7 @@ public class EasterHoliday extends Holiday
* Construct a holiday that falls on Easter Sunday every year
*
* @param name The name of the holiday
* @draft ICU 2.2
*/
public EasterHoliday(String name)
{
@ -42,6 +43,7 @@ public class EasterHoliday extends Holiday
*
* @param daysAfter The number of days before (-) or after (+) Easter
* @param name The name of the holiday
* @draft ICU 2.2
*/
public EasterHoliday(int daysAfter, String name)
{
@ -56,6 +58,7 @@ public class EasterHoliday extends Holiday
* @param daysAfter The number of days before (-) or after (+) Easter
* @param orthodox Use the Orthodox calendar?
* @param name The name of the holiday
* @draft ICU 2.2
*/
public EasterHoliday(int daysAfter, boolean orthodox, String name)
{
@ -64,61 +67,73 @@ public class EasterHoliday extends Holiday
/**
* Shrove Tuesday, aka Mardi Gras, 48 days before Easter
* @draft ICU 2.2
*/
static public final EasterHoliday SHROVE_TUESDAY = new EasterHoliday(-48, "Shrove Tuesday");
/**
* Ash Wednesday, start of Lent, 47 days before Easter
* @draft ICU 2.2
*/
static public final EasterHoliday ASH_WEDNESDAY = new EasterHoliday(-47, "Ash Wednesday");
/**
* Palm Sunday, 7 days before Easter
* @draft ICU 2.2
*/
static public final EasterHoliday PALM_SUNDAY = new EasterHoliday( -7, "Palm Sunday");
/**
* Maundy Thursday, 3 days before Easter
* @draft ICU 2.2
*/
static public final EasterHoliday MAUNDY_THURSDAY = new EasterHoliday( -3, "Maundy Thursday");
/**
* Good Friday, 2 days before Easter
* @draft ICU 2.2
*/
static public final EasterHoliday GOOD_FRIDAY = new EasterHoliday( -2, "Good Friday");
/**
* Easter Sunday
* @draft ICU 2.2
*/
static public final EasterHoliday EASTER_SUNDAY = new EasterHoliday( 0, "Easter Sunday");
/**
* Easter Monday, 1 day after Easter
* @draft ICU 2.2
*/
static public final EasterHoliday EASTER_MONDAY = new EasterHoliday( 1, "Easter Monday");
/**
* Ascension, 39 days after Easter
* @draft ICU 2.2
*/
static public final EasterHoliday ASCENSION = new EasterHoliday( 39, "Ascension");
/**
* Pentecost (aka Whit Sunday), 49 days after Easter
* @draft ICU 2.2
*/
static public final EasterHoliday PENTECOST = new EasterHoliday( 49, "Pentecost");
/**
* Whit Sunday (aka Pentecost), 49 days after Easter
* @draft ICU 2.2
*/
static public final EasterHoliday WHIT_SUNDAY = new EasterHoliday( 49, "Whit Sunday");
/**
* Whit Monday, 50 days after Easter
* @draft ICU 2.2
*/
static public final EasterHoliday WHIT_MONDAY = new EasterHoliday( 50, "Whit Monday");
/**
* Corpus Christi, 60 days after Easter
* @draft ICU 2.2
*/
static public final EasterHoliday CORPUS_CHRISTI = new EasterHoliday( 60, "Corpus Christi");
}
@ -275,5 +290,4 @@ class EasterRule implements DateRule {
int daysAfterEaster;
Date startDate = null;
GregorianCalendar calendar = gregorian;
}

View file

@ -2,8 +2,6 @@
* Copyright (C) 1996-2002, International Business Machines
* Corporation and others. All Rights Reserved.
*/
package com.ibm.icu.util;
import java.util.Date;
import java.util.Locale;
@ -162,9 +160,8 @@ import java.util.Locale;
*
* @see Calendar
* @see TimeZone
* @version 1.52
* @author David Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu
* @since JDK1.1
* @stable
*/
public class GregorianCalendar extends Calendar {
/*
@ -209,6 +206,7 @@ public class GregorianCalendar extends Calendar {
* The sequence of years at the transition from <code>BC</code> to <code>AD</code> is
* ..., 2 BC, 1 BC, 1 AD, 2 AD,...
* @see Calendar#ERA
* @stable
*/
public static final int BC = 0;
@ -218,6 +216,7 @@ public class GregorianCalendar extends Calendar {
* The sequence of years at the transition from <code>BC</code> to <code>AD</code> is
* ..., 2 BC, 1 BC, 1 AD, 2 AD,...
* @see Calendar#ERA
* @stable
*/
public static final int AD = 1;
@ -273,6 +272,9 @@ public class GregorianCalendar extends Calendar {
{/* */}, // MILLISECONDS_IN_DAY
};
/**
* @stable
*/
protected int handleGetLimit(int field, int limitType) {
return LIMITS[field][limitType];
}
@ -304,11 +306,13 @@ public class GregorianCalendar extends Calendar {
/**
* Used by handleComputeJulianDay() and handleComputeMonthStart().
* @stable
*/
transient protected boolean isGregorian;
/**
* Used by handleComputeJulianDay() and handleComputeMonthStart().
* @stable
*/
transient protected boolean invertGregorian;
@ -319,6 +323,7 @@ public class GregorianCalendar extends Calendar {
/**
* Constructs a default GregorianCalendar using the current time
* in the default time zone with the default locale.
* @stable
*/
public GregorianCalendar() {
this(TimeZone.getDefault(), Locale.getDefault());
@ -328,6 +333,7 @@ public class GregorianCalendar extends Calendar {
* Constructs a GregorianCalendar based on the current time
* in the given time zone with the default locale.
* @param zone the given time zone.
* @stable
*/
public GregorianCalendar(TimeZone zone) {
this(zone, Locale.getDefault());
@ -337,6 +343,7 @@ public class GregorianCalendar extends Calendar {
* Constructs a GregorianCalendar based on the current time
* in the default time zone with the given locale.
* @param aLocale the given locale.
* @stable
*/
public GregorianCalendar(Locale aLocale) {
this(TimeZone.getDefault(), aLocale);
@ -347,6 +354,7 @@ public class GregorianCalendar extends Calendar {
* in the given time zone with the given locale.
* @param zone the given time zone.
* @param aLocale the given locale.
* @stable
*/
public GregorianCalendar(TimeZone zone, Locale aLocale) {
super(zone, aLocale);
@ -360,6 +368,7 @@ public class GregorianCalendar extends Calendar {
* @param month the value used to set the MONTH time field in the calendar.
* Month value is 0-based. e.g., 0 for January.
* @param date the value used to set the DATE time field in the calendar.
* @stable
*/
public GregorianCalendar(int year, int month, int date) {
super(TimeZone.getDefault(), Locale.getDefault());
@ -380,6 +389,7 @@ public class GregorianCalendar extends Calendar {
* in the calendar.
* @param minute the value used to set the MINUTE time field
* in the calendar.
* @stable
*/
public GregorianCalendar(int year, int month, int date, int hour,
int minute) {
@ -405,6 +415,7 @@ public class GregorianCalendar extends Calendar {
* in the calendar.
* @param second the value used to set the SECOND time field
* in the calendar.
* @stable
*/
public GregorianCalendar(int year, int month, int date, int hour,
int minute, int second) {
@ -432,6 +443,7 @@ public class GregorianCalendar extends Calendar {
* set the change date to <code>Date(Long.MIN_VALUE)</code>.
*
* @param date the given Gregorian cutover date.
* @stable
*/
public void setGregorianChange(Date date) {
gregorianCutover = date.getTime();
@ -462,6 +474,7 @@ public class GregorianCalendar extends Calendar {
* October 15, 1582. Previous to this, dates will be in the Julian
* calendar.
* @return the Gregorian cutover date for this calendar.
* @stable
*/
public final Date getGregorianChange() {
return new Date(gregorianCutover);
@ -472,6 +485,7 @@ public class GregorianCalendar extends Calendar {
* given year is a leap year.
* @param year the given year.
* @return true if the given year is a leap year; false otherwise.
* @stable
*/
public boolean isLeapYear(int year) {
return year >= gregorianCutoverYear ?
@ -484,7 +498,7 @@ public class GregorianCalendar extends Calendar {
* one. Calendar override.
*
* @param other the Calendar to be compared with this Calendar
* @since ICU 2.4
* @draft ICU 2.4
*/
public boolean isEquivalentTo(Calendar other) {
return super.isEquivalentTo(other) &&
@ -494,6 +508,7 @@ public class GregorianCalendar extends Calendar {
/**
* Override hashCode.
* Generates the hash code for the GregorianCalendar object
* @stable
*/
public int hashCode() {
return super.hashCode() ^ (int)gregorianCutover;
@ -507,6 +522,7 @@ public class GregorianCalendar extends Calendar {
* @param field the time field.
* @param amount the amount of date or time to be added to the field.
* @exception IllegalArgumentException if an unknown field is given.
* @stable
*/
public void add(int field, int amount) {
switch (field) {
@ -531,6 +547,7 @@ public class GregorianCalendar extends Calendar {
/**
* Roll a field by a signed amount.
* @since 1.2
* @stable
*/
public void roll(int field, int amount) {
@ -600,6 +617,7 @@ public class GregorianCalendar extends Calendar {
* Return the minimum value that this field could have, given the current date.
* For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
* @since 1.2
* @stable
*/
public int getActualMinimum(int field) {
return getMinimum(field);
@ -611,6 +629,7 @@ public class GregorianCalendar extends Calendar {
* maximum would be 28; for "Feb 3, 1996" it s 29. Similarly for a Hebrew calendar,
* for some years the actual maximum for MONTH is 12, and for others 13.
* @since 1.2
* @stable
*/
public int getActualMaximum(int field) {
/* It is a known limitation that the code here (and in getActualMinimum)
@ -707,10 +726,16 @@ public class GregorianCalendar extends Calendar {
// Calendar framework
/////////////////////
/**
* @stable
*/
protected int handleGetMonthLength(int extendedYear, int month) {
return MONTH_COUNT[month][isLeapYear(extendedYear)?1:0];
}
/**
* @stable
*/
protected int handleGetYearLength(int eyear) {
return isLeapYear(eyear) ? 366 : 365;
}
@ -729,6 +754,7 @@ public class GregorianCalendar extends Calendar {
* <li>DAY_OF_MONTH
* <li>DAY_OF_YEAR
* <li>EXTENDED_YEAR</ul>
* @stable
*/
protected void handleComputeFields(int julianDay) {
int eyear, month, dayOfMonth, dayOfYear;
@ -783,6 +809,9 @@ public class GregorianCalendar extends Calendar {
// Fields => Time computation
/////////////////////////////
/**
* @stable
*/
protected int handleGetExtendedYear() {
int year;
if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) {
@ -807,6 +836,7 @@ public class GregorianCalendar extends Calendar {
* @param millis milliseconds of the date fields
* @param millisInDay milliseconds of the time fields; may be out
* or range.
* @stable
*/
protected int computeZoneOffset(long millis, int millisInDay) {
@ -850,6 +880,9 @@ public class GregorianCalendar extends Calendar {
// of cessation is 2:00 am).
}
/**
* @stable
*/
protected int handleComputeJulianDay(int bestField) {
invertGregorian = false;
@ -866,7 +899,10 @@ public class GregorianCalendar extends Calendar {
return jd;
}
// Return JD of start of given month/year
/**
* Return JD of start of given month/year
* @stable
*/
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
// If the month is out of range, adjust it into range, and
@ -903,6 +939,7 @@ public class GregorianCalendar extends Calendar {
return julianDay;
}
/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
if (factory == null) {
@ -918,4 +955,5 @@ public class GregorianCalendar extends Calendar {
}
return factory;
}
*/
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/HebrewCalendar.java,v $
* $Date: 2002/10/02 20:20:24 $
* $Revision: 1.10 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.11 $
*
*****************************************************************************************
*/
@ -65,6 +65,7 @@ import java.util.Locale;
*
* @author Laura Werner
* @author Alan Liu
* @stable
*/
public class HebrewCalendar extends Calendar {
@ -74,19 +75,19 @@ public class HebrewCalendar extends Calendar {
// Tons o' Constants...
//-------------------------------------------------------------------------
/** Constant for Tishri, the 1st month of the Hebrew year. */
/** Constant for Tishri, the 1st month of the Hebrew year. @stable */
public static final int TISHRI = 0;
/** Constant for Heshvan, the 2nd month of the Hebrew year. */
/** Constant for Heshvan, the 2nd month of the Hebrew year. @stable */
public static final int HESHVAN = 1;
/** Constant for Kislev, the 3rd month of the Hebrew year. */
/** Constant for Kislev, the 3rd month of the Hebrew year. @stable */
public static final int KISLEV = 2;
/** Constant for Tevet, the 4th month of the Hebrew year. */
/** Constant for Tevet, the 4th month of the Hebrew year. @stable */
public static final int TEVET = 3;
/** Constant for Shevat, the 5th month of the Hebrew year. */
/** Constant for Shevat, the 5th month of the Hebrew year. @stable */
public static final int SHEVAT = 4;
/**
@ -96,25 +97,25 @@ public class HebrewCalendar extends Calendar {
*/
public static final int ADAR_1 = 5;
/** Constant for the Adar, the 7th month of the Hebrew year. */
/** Constant for the Adar, the 7th month of the Hebrew year. @stable */
public static final int ADAR = 6;
/** Constant for Nisan, the 8th month of the Hebrew year. */
/** Constant for Nisan, the 8th month of the Hebrew year. @stable */
public static final int NISAN = 7;
/** Constant for Iyar, the 9th month of the Hebrew year. */
/** Constant for Iyar, the 9th month of the Hebrew year. @stable */
public static final int IYAR = 8;
/** Constant for Sivan, the 10th month of the Hebrew year. */
/** Constant for Sivan, the 10th month of the Hebrew year. @stable */
public static final int SIVAN = 9;
/** Constant for Tammuz, the 11th month of the Hebrew year. */
/** Constant for Tammuz, the 11th month of the Hebrew year. @stable */
public static final int TAMUZ = 10;
/** Constant for Av, the 12th month of the Hebrew year. */
/** Constant for Av, the 12th month of the Hebrew year. @stable */
public static final int AV = 11;
/** Constant for Elul, the 13th month of the Hebrew year. */
/** Constant for Elul, the 13th month of the Hebrew year. @stable */
public static final int ELUL = 12;
/**
@ -233,6 +234,7 @@ public class HebrewCalendar extends Calendar {
/**
* Constructs a default <code>HebrewCalendar</code> using the current time
* in the default time zone with the default locale.
* @stable
*/
public HebrewCalendar() {
this(TimeZone.getDefault(), Locale.getDefault());
@ -243,6 +245,7 @@ public class HebrewCalendar extends Calendar {
* in the given time zone with the default locale.
*
* @param zone The time zone for the new calendar.
* @stable
*/
public HebrewCalendar(TimeZone zone) {
this(zone, Locale.getDefault());
@ -253,6 +256,7 @@ public class HebrewCalendar extends Calendar {
* in the default time zone with the given locale.
*
* @param aLocale The locale for the new calendar.
* @stable
*/
public HebrewCalendar(Locale aLocale) {
this(TimeZone.getDefault(), aLocale);
@ -265,6 +269,7 @@ public class HebrewCalendar extends Calendar {
* @param zone The time zone for the new calendar.
*
* @param aLocale The locale for the new calendar.
* @stable
*/
public HebrewCalendar(TimeZone zone, Locale aLocale) {
super(zone, aLocale);
@ -281,6 +286,7 @@ public class HebrewCalendar extends Calendar {
* The value is 0-based. e.g., 0 for Tishri.
*
* @param date The value used to set the calendar's {@link #DATE DATE} time field.
* @stable
*/
public HebrewCalendar(int year, int month, int date) {
super(TimeZone.getDefault(), Locale.getDefault());
@ -294,6 +300,7 @@ public class HebrewCalendar extends Calendar {
* in the default time zone with the default locale.
*
* @param date The date to which the new calendar is set.
* @stable
*/
public HebrewCalendar(Date date) {
super(TimeZone.getDefault(), Locale.getDefault());
@ -316,6 +323,7 @@ public class HebrewCalendar extends Calendar {
* @param minute The value used to set the calendar's {@link #MINUTE MINUTE} time field.
*
* @param second The value used to set the calendar's {@link #SECOND SECOND} time field.
* @stable
*/
public HebrewCalendar(int year, int month, int date, int hour,
int minute, int second)
@ -361,6 +369,7 @@ public class HebrewCalendar extends Calendar {
*
* @exception IllegalArgumentException if the field is invalid or refers
* to a field that cannot be handled by this method.
* @stable
*/
public void add(int field, int amount)
{
@ -464,6 +473,7 @@ public class HebrewCalendar extends Calendar {
*
* @exception IllegalArgumentException if the field is invalid or refers
* to a field that cannot be handled by this method.
* @stable
*/
public void roll(int field, int amount)
{
@ -634,12 +644,16 @@ public class HebrewCalendar extends Calendar {
// Calendar framework
//-------------------------------------------------------------------------
/**
* @stable
*/
protected int handleGetLimit(int field, int limitType) {
return LIMITS[field][limitType];
}
/**
* Returns the length of the given month in the given year
* @stable
*/
protected int handleGetMonthLength(int extendedYear, int month) {
@ -657,6 +671,7 @@ public class HebrewCalendar extends Calendar {
/**
* Returns the number of days in the given Hebrew year
* @stable
*/
protected int handleGetYearLength(int eyear) {
return (int)(startOfYear(eyear+1) - startOfYear(eyear));
@ -685,6 +700,7 @@ public class HebrewCalendar extends Calendar {
* <p>In addition, subclasses should compute any subclass-specific
* fields, that is, fields from BASE_FIELD_COUNT to
* getFieldCount() - 1.
* @stable
*/
protected void handleComputeFields(int julianDay) {
long d = julianDay - 347997;
@ -723,6 +739,9 @@ public class HebrewCalendar extends Calendar {
// Functions for converting from field values to milliseconds
//-------------------------------------------------------------------------
/**
* @stable
*/
protected int handleGetExtendedYear() {
int year;
if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) {
@ -733,7 +752,10 @@ public class HebrewCalendar extends Calendar {
return year;
}
// Return JD of start of given month/year
/**
* Return JD of start of given month/year.
* @stable
*/
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
// Resolve out-of-range months. This is necessary in order to
@ -766,6 +788,7 @@ public class HebrewCalendar extends Calendar {
return (int) (day + 347997);
}
/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
if (factory == null) {
@ -781,4 +804,5 @@ public class HebrewCalendar extends Calendar {
}
return factory;
}
*/
}

View file

@ -5,14 +5,17 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/HebrewHoliday.java,v $
* $Date: 2002/02/16 03:06:28 $
* $Revision: 1.4 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.5 $
*
*****************************************************************************************
*/
package com.ibm.icu.util;
/**
* @draft ICU 2.2
*/
public class HebrewHoliday extends Holiday
{
private static final HebrewCalendar gCalendar = new HebrewCalendar();
@ -21,12 +24,16 @@ public class HebrewHoliday extends Holiday
* Construct a holiday defined in reference to the Hebrew calendar.
*
* @param name The name of the holiday
* @draft ICU 2.2
*/
public HebrewHoliday(int month, int date, String name)
{
this(month, date, 1, name);
}
/**
* @draft ICU 2.2
*/
public HebrewHoliday(int month, int date, int length, String name)
{
super(name, null);
@ -37,30 +44,123 @@ public class HebrewHoliday extends Holiday
setRule(rule);
}
public static HebrewHoliday
ROSH_HASHANAH = new HebrewHoliday(HebrewCalendar.TISHRI, 1, 2, "Rosh Hashanah"),
GEDALIAH = new HebrewHoliday(HebrewCalendar.TISHRI, 3, "Fast of Gedaliah"),
YOM_KIPPUR = new HebrewHoliday(HebrewCalendar.TISHRI, 10, "Yom Kippur"),
SUKKOT = new HebrewHoliday(HebrewCalendar.TISHRI, 15, 6, "Sukkot"),
HOSHANAH_RABBAH = new HebrewHoliday(HebrewCalendar.TISHRI, 21, "Hoshanah Rabbah"),
SHEMINI_ATZERET = new HebrewHoliday(HebrewCalendar.TISHRI, 22, "Shemini Atzeret"),
SIMCHAT_TORAH = new HebrewHoliday(HebrewCalendar.TISHRI, 23, "Simchat Torah"),
HANUKKAH = new HebrewHoliday(HebrewCalendar.KISLEV, 25, "Hanukkah"),
TEVET_10 = new HebrewHoliday(HebrewCalendar.TEVET, 10, "Fast of Tevet 10"),
TU_BSHEVAT = new HebrewHoliday(HebrewCalendar.SHEVAT, 15, "Tu B'Shevat"),
ESTHER = new HebrewHoliday(HebrewCalendar.ADAR, 13, "Fast of Esther"),
PURIM = new HebrewHoliday(HebrewCalendar.ADAR, 14, "Purim"),
SHUSHAN_PURIM = new HebrewHoliday(HebrewCalendar.ADAR, 15, "Shushan Purim"),
PASSOVER = new HebrewHoliday(HebrewCalendar.NISAN, 15, 8, "Passover"),
YOM_HASHOAH = new HebrewHoliday(HebrewCalendar.NISAN, 27, "Yom Hashoah"),
YOM_HAZIKARON = new HebrewHoliday(HebrewCalendar.IYAR, 4, "Yom Hazikaron"),
YOM_HAATZMAUT = new HebrewHoliday(HebrewCalendar.IYAR, 5, "Yom Ha'Atzmaut"),
PESACH_SHEINI = new HebrewHoliday(HebrewCalendar.IYAR, 14, "Pesach Sheini"),
LAG_BOMER = new HebrewHoliday(HebrewCalendar.IYAR, 18, "Lab B'Omer"),
YOM_YERUSHALAYIM= new HebrewHoliday(HebrewCalendar.IYAR, 28, "Yom Yerushalayim"),
SHAVUOT = new HebrewHoliday(HebrewCalendar.SIVAN, 6, 2, "Shavuot"),
TAMMUZ_17 = new HebrewHoliday(HebrewCalendar.TAMUZ, 17, "Fast of Tammuz 17"),
TISHA_BAV = new HebrewHoliday(HebrewCalendar.AV, 9, "Fast of Tisha B'Av"),
SELIHOT = new HebrewHoliday(HebrewCalendar.ELUL, 21, "Selihot");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday ROSH_HASHANAH = new HebrewHoliday(HebrewCalendar.TISHRI, 1, 2, "Rosh Hashanah");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday GEDALIAH = new HebrewHoliday(HebrewCalendar.TISHRI, 3, "Fast of Gedaliah");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday YOM_KIPPUR = new HebrewHoliday(HebrewCalendar.TISHRI, 10, "Yom Kippur");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday SUKKOT = new HebrewHoliday(HebrewCalendar.TISHRI, 15, 6, "Sukkot");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday HOSHANAH_RABBAH = new HebrewHoliday(HebrewCalendar.TISHRI, 21, "Hoshanah Rabbah");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday SHEMINI_ATZERET = new HebrewHoliday(HebrewCalendar.TISHRI, 22, "Shemini Atzeret");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday SIMCHAT_TORAH = new HebrewHoliday(HebrewCalendar.TISHRI, 23, "Simchat Torah");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday HANUKKAH = new HebrewHoliday(HebrewCalendar.KISLEV, 25, "Hanukkah");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday TEVET_10 = new HebrewHoliday(HebrewCalendar.TEVET, 10, "Fast of Tevet 10");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday TU_BSHEVAT = new HebrewHoliday(HebrewCalendar.SHEVAT, 15, "Tu B'Shevat");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday ESTHER = new HebrewHoliday(HebrewCalendar.ADAR, 13, "Fast of Esther");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday PURIM = new HebrewHoliday(HebrewCalendar.ADAR, 14, "Purim");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday SHUSHAN_PURIM = new HebrewHoliday(HebrewCalendar.ADAR, 15, "Shushan Purim");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday PASSOVER = new HebrewHoliday(HebrewCalendar.NISAN, 15, 8, "Passover");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday YOM_HASHOAH = new HebrewHoliday(HebrewCalendar.NISAN, 27, "Yom Hashoah");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday YOM_HAZIKARON = new HebrewHoliday(HebrewCalendar.IYAR, 4, "Yom Hazikaron");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday YOM_HAATZMAUT = new HebrewHoliday(HebrewCalendar.IYAR, 5, "Yom Ha'Atzmaut");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday PESACH_SHEINI = new HebrewHoliday(HebrewCalendar.IYAR, 14, "Pesach Sheini");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday LAG_BOMER = new HebrewHoliday(HebrewCalendar.IYAR, 18, "Lab B'Omer");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday YOM_YERUSHALAYIM = new HebrewHoliday(HebrewCalendar.IYAR, 28, "Yom Yerushalayim");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday SHAVUOT = new HebrewHoliday(HebrewCalendar.SIVAN, 6, 2, "Shavuot");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday TAMMUZ_17 = new HebrewHoliday(HebrewCalendar.TAMUZ, 17, "Fast of Tammuz 17");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday TISHA_BAV = new HebrewHoliday(HebrewCalendar.AV, 9, "Fast of Tisha B'Av");
/**
* @draft ICU 2.2
*/
public static HebrewHoliday SELIHOT = new HebrewHoliday(HebrewCalendar.ELUL, 21, "Selihot");
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Holiday.java,v $
* $Date: 2002/03/10 19:40:17 $
* $Revision: 1.5 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.6 $
*
*****************************************************************************************
*/
@ -24,15 +24,21 @@ import java.util.ResourceBundle;
* An abstract class representing a holiday. This class simply adds
* a holiday name to the DateRule interface for calculating the date
* of an event.
*
* @draft ICU 2.2
*/
public abstract class Holiday implements DateRule
{
/**
* @draft ICU 2.2
*/
public static Holiday[] getHolidays()
{
return getHolidays(Locale.getDefault());
}
/**
* @draft ICU 2.2
*/
public static Holiday[] getHolidays(Locale locale)
{
Holiday[] result = noHolidays;
@ -56,6 +62,7 @@ public abstract class Holiday implements DateRule
* does not occur on or after the start date.
*
* @see #firstBetween
* @draft ICU 2.2
*/
public Date firstAfter(Date start) {
return rule.firstAfter(start);
@ -72,6 +79,7 @@ public abstract class Holiday implements DateRule
* does not occur between the start and end dates.
*
* @see #firstAfter
* @draft ICU 2.2
*/
public Date firstBetween(Date start, Date end) {
return rule.firstBetween(start, end);
@ -84,6 +92,7 @@ public abstract class Holiday implements DateRule
*
* @param date The date to check.
* @return true if this holiday occurs on the given date.
* @draft ICU 2.2
*
*/
public boolean isOn(Date date) {
@ -94,6 +103,7 @@ public abstract class Holiday implements DateRule
/**
* Check whether this holiday occurs at least once between the two
* dates given.
* @draft ICU 2.2
*/
public boolean isBetween(Date start, Date end) {
return rule.isBetween(start, end);
@ -110,6 +120,7 @@ public abstract class Holiday implements DateRule
* @param rule The date rules used for determining when this holiday
* falls. Holiday's implementation of the DateRule inteface
* simply delegates to this DateRule object.
* @draft ICU 2.2
*/
protected Holiday(String name, DateRule rule)
{
@ -119,6 +130,7 @@ public abstract class Holiday implements DateRule
/**
* Return the name of this holiday in the language of the default locale
* @draft ICU 2.2
*/
public String getDisplayName() {
return getDisplayName(Locale.getDefault());
@ -133,6 +145,7 @@ public abstract class Holiday implements DateRule
* @param loc A locale specifying the language in which the name is desired.
*
* @see ResourceBundle
* @draft ICU 2.2
*/
public String getDisplayName(Locale locale)
{
@ -148,10 +161,16 @@ public abstract class Holiday implements DateRule
return name;
}
/**
* @draft ICU 2.2
*/
public DateRule getRule() {
return rule;
}
/**
* @draft ICU 2.2
*/
public void setRule(DateRule rule) {
this.rule = rule;
}
@ -160,5 +179,4 @@ public abstract class Holiday implements DateRule
private DateRule rule;
private static Holiday[] noHolidays = {};
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/IslamicCalendar.java,v $
* $Date: 2002/10/02 20:20:24 $
* $Revision: 1.12 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.13 $
*
*****************************************************************************************
*/
@ -72,6 +72,7 @@ import com.ibm.icu.util.CalendarAstronomer;
*
* @author Laura Werner
* @author Alan Liu
* @stable
*/
public class IslamicCalendar extends Calendar {
@ -81,40 +82,40 @@ public class IslamicCalendar extends Calendar {
// Constants...
//-------------------------------------------------------------------------
/** Constant for Muharram, the 1st month of the Islamic year. */
/** Constant for Muharram, the 1st month of the Islamic year. @stable */
public static final int MUHARRAM = 0;
/** Constant for Safar, the 2nd month of the Islamic year. */
/** Constant for Safar, the 2nd month of the Islamic year. @stable */
public static final int SAFAR = 1;
/** Constant for Rabi' al-awwal (or Rabi' I), the 3rd month of the Islamic year. */
/** Constant for Rabi' al-awwal (or Rabi' I), the 3rd month of the Islamic year. @stable */
public static final int RABI_1 = 2;
/** Constant for Rabi' al-thani or (Rabi' II), the 4th month of the Islamic year. */
/** Constant for Rabi' al-thani or (Rabi' II), the 4th month of the Islamic year. @stable */
public static final int RABI_2 = 3;
/** Constant for Jumada al-awwal or (Jumada I), the 5th month of the Islamic year. */
/** Constant for Jumada al-awwal or (Jumada I), the 5th month of the Islamic year. @stable */
public static final int JUMADA_1 = 4;
/** Constant for Jumada al-thani or (Jumada II), the 6th month of the Islamic year. */
/** Constant for Jumada al-thani or (Jumada II), the 6th month of the Islamic year. @stable */
public static final int JUMADA_2 = 5;
/** Constant for Rajab, the 7th month of the Islamic year. */
/** Constant for Rajab, the 7th month of the Islamic year. @stable */
public static final int RAJAB = 6;
/** Constant for Sha'ban, the 8th month of the Islamic year. */
/** Constant for Sha'ban, the 8th month of the Islamic year. @stable */
public static final int SHABAN = 7;
/** Constant for Ramadan, the 9th month of the Islamic year. */
/** Constant for Ramadan, the 9th month of the Islamic year. @stable */
public static final int RAMADAN = 8;
/** Constant for Shawwal, the 10th month of the Islamic year. */
/** Constant for Shawwal, the 10th month of the Islamic year. @stable */
public static final int SHAWWAL = 9;
/** Constant for Dhu al-Qi'dah, the 11th month of the Islamic year. */
/** Constant for Dhu al-Qi'dah, the 11th month of the Islamic year. @stable */
public static final int DHU_AL_QIDAH = 10;
/** Constant for Dhu al-Hijjah, the 12th month of the Islamic year. */
/** Constant for Dhu al-Hijjah, the 12th month of the Islamic year. @stable */
public static final int DHU_AL_HIJJAH = 11;
@ -127,6 +128,7 @@ public class IslamicCalendar extends Calendar {
/**
* Constructs a default <code>IslamicCalendar</code> using the current time
* in the default time zone with the default locale.
* @stable
*/
public IslamicCalendar()
{
@ -137,6 +139,7 @@ public class IslamicCalendar extends Calendar {
* Constructs an <code>IslamicCalendar</code> based on the current time
* in the given time zone with the default locale.
* @param zone the given time zone.
* @stable
*/
public IslamicCalendar(TimeZone zone)
{
@ -148,6 +151,7 @@ public class IslamicCalendar extends Calendar {
* in the default time zone with the given locale.
*
* @param aLocale the given locale.
* @stable
*/
public IslamicCalendar(Locale aLocale)
{
@ -159,8 +163,8 @@ public class IslamicCalendar extends Calendar {
* in the given time zone with the given locale.
*
* @param zone the given time zone.
*
* @param aLocale the given locale.
* @stable
*/
public IslamicCalendar(TimeZone zone, Locale aLocale)
{
@ -173,6 +177,7 @@ public class IslamicCalendar extends Calendar {
* in the default time zone with the default locale.
*
* @param date The date to which the new calendar is set.
* @stable
*/
public IslamicCalendar(Date date) {
super(TimeZone.getDefault(), Locale.getDefault());
@ -184,11 +189,10 @@ public class IslamicCalendar extends Calendar {
* in the default time zone with the default locale.
*
* @param year the value used to set the {@link #YEAR YEAR} time field in the calendar.
*
* @param month the value used to set the {@link #MONTH MONTH} time field in the calendar.
* Note that the month value is 0-based. e.g., 0 for Muharram.
*
* @param date the value used to set the {@link #DATE DATE} time field in the calendar.
* @stable
*/
public IslamicCalendar(int year, int month, int date)
{
@ -203,20 +207,16 @@ public class IslamicCalendar extends Calendar {
* and time set for the default time zone with the default locale.
*
* @param year the value used to set the {@link #YEAR YEAR} time field in the calendar.
*
* @param month the value used to set the {@link #MONTH MONTH} time field in the calendar.
* Note that the month value is 0-based. e.g., 0 for Muharram.
*
* @param date the value used to set the {@link #DATE DATE} time field in the calendar.
*
* @param hour the value used to set the {@link #HOUR_OF_DAY HOUR_OF_DAY} time field
* in the calendar.
*
* @param minute the value used to set the {@link #MINUTE MINUTE} time field
* in the calendar.
*
* @param second the value used to set the {@link #SECOND SECOND} time field
* in the calendar.
* @stable
*/
public IslamicCalendar(int year, int month, int date, int hour,
int minute, int second)
@ -236,6 +236,7 @@ public class IslamicCalendar extends Calendar {
*
* @param beCivil <code>true</code> to use the civil calendar,
* <code>false</code> to use the astronomical calendar.
* @stable
*/
public void setCivil(boolean beCivil)
{
@ -253,6 +254,7 @@ public class IslamicCalendar extends Calendar {
* Returns <code>true</code> if this object is using the fixed-cycle civil
* calendar, or <code>false</code> if using the religious, astronomical
* calendar.
* @stable
*/
public boolean isCivil() {
return civil;
@ -561,6 +563,7 @@ public class IslamicCalendar extends Calendar {
internalSet(DAY_OF_YEAR, dayOfYear);
}
/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
if (factory == null) {
@ -576,4 +579,5 @@ public class IslamicCalendar extends Calendar {
}
return factory;
}
*/
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/JapaneseCalendar.java,v $
* $Date: 2002/10/02 20:20:24 $
* $Revision: 1.9 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.10 $
*
*****************************************************************************************
*/
@ -44,6 +44,7 @@ import java.util.Locale;
*
* @author Laura Werner
* @author Alan Liu
* @stable
*/
public class JapaneseCalendar extends GregorianCalendar {
@ -56,6 +57,7 @@ public class JapaneseCalendar extends GregorianCalendar {
/**
* Constructs a default <code>JapaneseCalendar</code> using the current time
* in the default time zone with the default locale.
* @stable
*/
public JapaneseCalendar() {
super();
@ -65,6 +67,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* Constructs a <code>JapaneseCalendar</code> based on the current time
* in the given time zone with the default locale.
* @param zone the given time zone.
* @stable
*/
public JapaneseCalendar(TimeZone zone) {
super(zone);
@ -74,6 +77,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* Constructs a <code>JapaneseCalendar</code> based on the current time
* in the default time zone with the given locale.
* @param aLocale the given locale.
* @stable
*/
public JapaneseCalendar(Locale aLocale) {
super(aLocale);
@ -86,6 +90,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* @param zone the given time zone.
*
* @param aLocale the given locale.
* @stable
*/
public JapaneseCalendar(TimeZone zone, Locale aLocale) {
super(zone, aLocale);
@ -96,6 +101,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* in the default time zone with the default locale.
*
* @param date The date to which the new calendar is set.
* @stable
*/
public JapaneseCalendar(Date date) {
this();
@ -122,6 +128,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* The value is 0-based. e.g., 0 for January.
*
* @param date The value used to set the calendar's DATE field.
* @stable
*/
public JapaneseCalendar(int era, int year, int month, int date) {
super(year, month, date);
@ -140,6 +147,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* The value is 0-based. e.g., 0 for January.
*
* @param date The value used to set the calendar's {@link #DATE DATE} field.
* @stable
*/
public JapaneseCalendar(int year, int month, int date) {
super(year, month, date);
@ -164,6 +172,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* @param minute The value used to set the calendar's {@link #MINUTE MINUTE} time field.
*
* @param second The value used to set the calendar's {@link #SECOND SECOND} time field.
* @stable
*/
public JapaneseCalendar(int year, int month, int date, int hour,
int minute, int second)
@ -187,6 +196,9 @@ public class JapaneseCalendar extends GregorianCalendar {
return year;
}
/**
* @stable
*/
protected void handleComputeFields(int julianDay) {
super.handleComputeFields(julianDay);
int year = internalGet(EXTENDED_YEAR);
@ -510,6 +522,7 @@ public class JapaneseCalendar extends GregorianCalendar {
* Override GregorianCalendar. We should really handle YEAR_WOY and
* EXTENDED_YEAR here too to implement the 1..5000000 range, but it's
* not critical.
* @stable
*/
protected int handleGetLimit(int field, int limitType) {
switch (field) {
@ -536,6 +549,7 @@ public class JapaneseCalendar extends GregorianCalendar {
}
}
/*
private static CalendarFactory factory;
public static CalendarFactory factory() {
if (factory == null) {
@ -551,4 +565,5 @@ public class JapaneseCalendar extends GregorianCalendar {
}
return factory;
}
*/
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/RangeDateRule.java,v $
* $Date: 2002/02/16 03:06:29 $
* $Revision: 1.5 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.6 $
*
*****************************************************************************************
*/
@ -16,12 +16,22 @@ package com.ibm.icu.util;
import java.util.Date;
import java.util.Vector;
/**
* Implementation of DateRule that takes a range.
* @draft ICU 2.2
*/
public class RangeDateRule implements DateRule
{
/**
* @draft ICU 2.2
*/
public RangeDateRule()
{
}
/**
* @draft ICU 2.2
*/
public RangeDateRule(Range[] ranges)
{
for (int i = 0; i < ranges.length; i++) {
@ -29,11 +39,17 @@ public class RangeDateRule implements DateRule
}
}
/**
* @draft ICU 2.2
*/
public void add(DateRule rule)
{
add(new Date(Long.MIN_VALUE), rule);
}
/**
* @draft ICU 2.2
*/
public void add(Date start, DateRule rule)
{
// TODO: Insert in the right place
@ -43,6 +59,9 @@ public class RangeDateRule implements DateRule
//-----------------------------------------------------------------------
/**
* @draft ICU 2.2
*/
public Date firstAfter(Date start)
{
// Find the range that I should look at
@ -63,6 +82,9 @@ public class RangeDateRule implements DateRule
return result;
}
/**
* @draft ICU 2.2
*/
public Date firstBetween(Date start, Date end)
{
// Find the range that I should look at
@ -85,6 +107,9 @@ public class RangeDateRule implements DateRule
return result;
}
/**
* @draft ICU 2.2
*/
public boolean isOn(Date date)
{
return false;
@ -93,6 +118,7 @@ public class RangeDateRule implements DateRule
/**
* Check whether this event occurs at least once between the two
* dates given.
* @draft ICU 2.2
*/
public boolean isBetween(Date start, Date end)
{

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/SimpleDateRule.java,v $
* $Date: 2002/03/20 05:11:17 $
* $Revision: 1.7 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.8 $
*
*****************************************************************************************
*/
@ -18,6 +18,10 @@ import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
import com.ibm.icu.util.SimpleTimeZone;
/**
* Simple implementation of DateRule.
* @draft ICU 2.2
*/
public class SimpleDateRule implements DateRule
{
/**
@ -25,7 +29,7 @@ public class SimpleDateRule implements DateRule
*
* @param month The month in which this rule occurs (0-based).
* @param dayOfMonth The date in that month (1-based).
* </ul>
* @draft ICU 2.2
*/
public SimpleDateRule(int month, int dayOfMonth)
{
@ -43,7 +47,7 @@ public class SimpleDateRule implements DateRule
* @param after If true, this rule selects the first dayOfWeek
* on or after dayOfMonth. If false, the rule selects
* the first dayOfWeek on or before dayOfMonth.
* </ul>
* @draft ICU 2.2
*/
public SimpleDateRule(int month, int dayOfMonth, int dayOfWeek, boolean after)
{
@ -62,6 +66,7 @@ public class SimpleDateRule implements DateRule
* does not occur on or after the start date.
*
* @see #firstBetween
* @draft ICU 2.2
*/
public Date firstAfter(Date start)
{
@ -83,6 +88,7 @@ public class SimpleDateRule implements DateRule
* does not occur between the start and end dates.
*
* @see #firstAfter
* @draft ICU 2.2
*/
public Date firstBetween(Date start, Date end)
{
@ -105,6 +111,7 @@ public class SimpleDateRule implements DateRule
*
* @param date The date to check.
* @return true if this event occurs on the given date.
* @draft ICU 2.2
*
*/
public boolean isOn(Date date)
@ -135,6 +142,7 @@ public class SimpleDateRule implements DateRule
/**
* Check whether this event occurs at least once between the two
* dates given.
* @draft ICU 2.2
*/
public boolean isBetween(Date start, Date end)
{
@ -172,6 +180,7 @@ public class SimpleDateRule implements DateRule
return result;
}
}
private Date computeInYear(int year, Calendar c)
{
if (c == null) c = calendar;
@ -211,6 +220,9 @@ public class SimpleDateRule implements DateRule
}
}
/**
* @draft ICU 2.2
*/
public void setCalendar(Calendar c) {
calendar = c;
}

View file

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/SimpleHoliday.java,v $
* $Date: 2002/02/16 03:06:30 $
* $Revision: 1.5 $
* $Date: 2002/12/04 01:03:39 $
* $Revision: 1.6 $
*
*****************************************************************************************
*/
@ -21,6 +21,7 @@ import com.ibm.icu.util.GregorianCalendar;
* A holiday whose date can be represented by a SimpleDateRule object
*
* @see SimpleDateRule
* @draft ICU 2.2
*/
public class SimpleHoliday extends Holiday {
/**
@ -36,7 +37,7 @@ public class SimpleHoliday extends Holiday {
*
* @see SimpleDateRule
* @see Holiday#getDisplayName(java.util.Locale)
*
* @draft ICU 2.2
*/
public SimpleHoliday(int month, int dayOfMonth, String name)
{
@ -56,6 +57,7 @@ public class SimpleHoliday extends Holiday {
*
* @see SimpleDateRule
* @see Holiday#getDisplayName(java.util.Locale)
* @draft ICU 2.2
*
*/
public SimpleHoliday(int month, int dayOfMonth, String name,
@ -79,6 +81,7 @@ public class SimpleHoliday extends Holiday {
*
* @see SimpleDateRule
* @see Holiday#getDisplayName(java.util.Locale)
* @draft ICU 2.2
*
*/
public SimpleHoliday(int month, int dayOfMonth, String name,
@ -112,6 +115,7 @@ public class SimpleHoliday extends Holiday {
*
* @see SimpleDateRule
* @see Holiday#getDisplayName(java.util.Locale)
* @draft ICU 2.2
*
*/
public SimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name)
@ -121,7 +125,9 @@ public class SimpleHoliday extends Holiday {
dayOfWeek > 0) );
}
/**
* @draft ICU 2.2
*/
public SimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name,
int startYear)
{
@ -133,6 +139,9 @@ public class SimpleHoliday extends Holiday {
}
/**
* @draft ICU 2.2
*/
public SimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name,
int startYear, int endYear)
{
@ -166,72 +175,84 @@ public class SimpleHoliday extends Holiday {
/**
* New Year's Day - January 1st
* @draft ICU 2.2
*/
public static final SimpleHoliday NEW_YEARS_DAY =
new SimpleHoliday(Calendar.JANUARY, 1, "New Year's Day");
/**
* Epiphany, January 6th
* @draft ICU 2.2
*/
public static final SimpleHoliday EPIPHANY =
new SimpleHoliday(Calendar.JANUARY, 6, "Epiphany");
/**
* May Day, May 1st
* @draft ICU 2.2
*/
public static final SimpleHoliday MAY_DAY =
new SimpleHoliday(Calendar.MAY, 1, "May Day");
/**
* Assumption, August 15th
* @draft ICU 2.2
*/
public static final SimpleHoliday ASSUMPTION =
new SimpleHoliday(Calendar.AUGUST, 15, "Assumption");
/**
* All Saints' Day, November 1st
* @draft ICU 2.2
*/
public static final SimpleHoliday ALL_SAINTS_DAY =
new SimpleHoliday(Calendar.NOVEMBER, 1, "All Saints' Day");
/**
* All Souls' Day, November 1st
* @draft ICU 2.2
*/
public static final SimpleHoliday ALL_SOULS_DAY =
new SimpleHoliday(Calendar.NOVEMBER, 2, "All Souls' Day");
/**
* Immaculate Conception, December 8th
* @draft ICU 2.2
*/
public static final SimpleHoliday IMMACULATE_CONCEPTION =
new SimpleHoliday(Calendar.DECEMBER, 8, "Immaculate Conception");
/**
* Christmas Eve, December 24th
* @draft ICU 2.2
*/
public static final SimpleHoliday CHRISTMAS_EVE =
new SimpleHoliday(Calendar.DECEMBER, 24, "Christmas Eve");
/**
* Christmas, December 25th
* @draft ICU 2.2
*/
public static final SimpleHoliday CHRISTMAS =
new SimpleHoliday(Calendar.DECEMBER, 25, "Christmas");
/**
* Boxing Day, December 26th
* @draft ICU 2.2
*/
public static final SimpleHoliday BOXING_DAY =
new SimpleHoliday(Calendar.DECEMBER, 26, "Boxing Day");
/**
* Saint Stephen's Day, December 26th
* @draft ICU 2.2
*/
public static final SimpleHoliday ST_STEPHENS_DAY =
new SimpleHoliday(Calendar.DECEMBER, 26, "St. Stephen's Day");
/**
* New Year's Eve, December 31st
* @draft ICU 2.2
*/
public static final SimpleHoliday NEW_YEARS_EVE =
new SimpleHoliday(Calendar.DECEMBER, 31, "New Year's Eve");

View file

@ -24,8 +24,8 @@ import java.util.Date;
* @see Calendar
* @see GregorianCalendar
* @see TimeZone
* @version 1.38 01/19/00
* @author David Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu
* @stable
*/
public class SimpleTimeZone extends TimeZone {
/**
@ -37,6 +37,7 @@ public class SimpleTimeZone extends TimeZone {
* @param rawOffset The given base time zone offset to GMT.
* @param ID The time zone ID which is obtained from
* TimeZone.getAvailableIDs.
* @stable
*/
public SimpleTimeZone(int rawOffset, String ID)
{
@ -101,7 +102,7 @@ public class SimpleTimeZone extends TimeZone {
* member description for an example.
* @exception IllegalArgumentException the month, day, dayOfWeek, or time
* parameters are out of range for the start or end rule
* @since JDK1.1
* @stable
*/
public SimpleTimeZone(int rawOffset, String ID,
int startMonth, int startDay, int startDayOfWeek, int startTime,
@ -119,7 +120,7 @@ public class SimpleTimeZone extends TimeZone {
* @param dstSavings The amount of time in ms saved during DST.
* @exception IllegalArgumentException the month, day, dayOfWeek, or time
* parameters are out of range for the start or end rule
* @since 1.2
* @stable
*/
public SimpleTimeZone(int rawOffset, String ID,
int startMonth, int startDay, int startDayOfWeek, int startTime,
@ -193,6 +194,7 @@ public class SimpleTimeZone extends TimeZone {
* Sets the daylight savings starting year.
*
* @param year The daylight savings starting year.
* @stable
*/
public void setStartYear(int year)
{
@ -218,6 +220,7 @@ public class SimpleTimeZone extends TimeZone {
* the member description for an example.
* @exception IllegalArgumentException the month, dayOfWeekInMonth,
* dayOfWeek, or time parameters are out of range
* @stable
*/
public void setStartRule(int month, int dayOfWeekInMonth, int dayOfWeek,
int time)
@ -241,7 +244,7 @@ public class SimpleTimeZone extends TimeZone {
* standard time in this case.
* @exception IllegalArgumentException the month,
* dayOfMonth, or time parameters are out of range
* @since 1.2
* @stable
*/
public void setStartRule(int month, int dayOfMonth, int time) {
setStartRule(month, dayOfMonth, 0, time);
@ -262,7 +265,7 @@ public class SimpleTimeZone extends TimeZone {
* the last dayOfWeek on or before dayOfMonth.
* @exception IllegalArgumentException the month, dayOfMonth,
* dayOfWeek, or time parameters are out of range
* @since 1.2
* @stable
*/
public void setStartRule(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)
{
@ -290,6 +293,7 @@ public class SimpleTimeZone extends TimeZone {
* member description for an example.
* @exception IllegalArgumentException the month, dayOfWeekInMonth,
* dayOfWeek, or time parameters are out of range
* @stable
*/
public void setEndRule(int month, int dayOfWeekInMonth, int dayOfWeek,
int time)
@ -313,7 +317,7 @@ public class SimpleTimeZone extends TimeZone {
* time in this case.
* @exception IllegalArgumentException the month,
* dayOfMonth, or time parameters are out of range
* @since 1.2
* @stable
*/
public void setEndRule(int month, int dayOfMonth, int time)
{
@ -335,7 +339,7 @@ public class SimpleTimeZone extends TimeZone {
* the last dayOfWeek on or before dayOfMonth.
* @exception IllegalArgumentException the month, dayOfMonth,
* dayOfWeek, or time parameters are out of range
* @since 1.2
* @stable
*/
public void setEndRule(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)
{
@ -369,6 +373,7 @@ public class SimpleTimeZone extends TimeZone {
* @return The milliseconds to add to UTC to get local time.
* @exception IllegalArgumentException the era, month, day,
* dayOfWeek, or millis parameters are out of range
* @stable
*/
public int getOffset(int era, int year, int month, int day, int dayOfWeek,
int millis)
@ -611,6 +616,7 @@ public class SimpleTimeZone extends TimeZone {
/**
* Overrides TimeZone
* Gets the GMT offset for this time zone.
* @stable
*/
public int getRawOffset()
{
@ -624,6 +630,7 @@ public class SimpleTimeZone extends TimeZone {
* Sets the base time zone offset to GMT.
* This is the offset to add *to* UTC to get local time.
* Please see TimeZone.setRawOffset for descriptions on the parameter.
* @stable
*/
public void setRawOffset(int offsetMillis)
{
@ -635,7 +642,7 @@ public class SimpleTimeZone extends TimeZone {
* @param millisSavedDuringDST the number of milliseconds the time is
* advanced with respect to standard time when the daylight savings rules
* are in effect. A positive number, typically one hour (3600000).
* @since 1.2
* @stable
*/
public void setDSTSavings(int millisSavedDuringDST) {
if (millisSavedDuringDST <= 0) {
@ -649,7 +656,7 @@ public class SimpleTimeZone extends TimeZone {
* @return the number of milliseconds the time is
* advanced with respect to standard time when the daylight savings rules
* are in effect. A positive number, typically one hour (3600000).
* @since 1.2
* @stable
*/
public int getDSTSavings() {
return dstSavings;
@ -658,6 +665,7 @@ public class SimpleTimeZone extends TimeZone {
/**
* Overrides TimeZone
* Queries if this time zone uses Daylight Savings Time.
* @stable
*/
public boolean useDaylightTime()
{
@ -677,6 +685,7 @@ public class SimpleTimeZone extends TimeZone {
/**
* Overrides Cloneable
* @stable
*/
public Object clone()
{
@ -687,6 +696,7 @@ public class SimpleTimeZone extends TimeZone {
/**
* Override hashCode.
* Generates the hash code for the SimpleDateFormat object
* @stable
*/
public synchronized int hashCode()
{
@ -700,6 +710,7 @@ public class SimpleTimeZone extends TimeZone {
* @param obj The SimpleTimeZone object to be compared with.
* @return True if the given obj is the same as this SimpleTimeZone
* object; false otherwise.
* @stable
*/
public boolean equals(Object obj)
{
@ -718,7 +729,7 @@ public class SimpleTimeZone extends TimeZone {
* Return true if this zone has the same rules and offset as another zone.
* @param other the TimeZone object to be compared with
* @return true if the given zone has the same rules and offset as this one
* @since 1.2
* @stable
*/
public boolean hasSameRules(TimeZone other) {
if (this == other) return true;
@ -747,6 +758,7 @@ public class SimpleTimeZone extends TimeZone {
/**
* Return a string representation of this time zone.
* @return a string representation of this time zone.
* @stable
*/
public String toString() {
return getClass().getName() +
@ -828,7 +840,6 @@ public class SimpleTimeZone extends TimeZone {
/**
* The format of startTime, either WALL_TIME, STANDARD_TIME, or UTC_TIME.
* @serial
* @since JDK 1.3
*/
private int startTimeMode;
@ -889,7 +900,6 @@ public class SimpleTimeZone extends TimeZone {
/**
* The format of endTime, either WALL_TIME, STANDARD_TIME, or UTC_TIME.
* @serial
* @since JDK 1.3
*/
private int endTimeMode;
@ -960,7 +970,6 @@ public class SimpleTimeZone extends TimeZone {
* <code>startDay</code> field.
* <p>If <code>useDaylight</code> is false, this value is ignored.
* @serial
* @since JDK1.1.4
*/
private int startMode;
@ -989,7 +998,6 @@ public class SimpleTimeZone extends TimeZone {
* <code>endDay</code> field.
* <p>If <code>useDaylight</code> is false, this value is ignored.
* @serial
* @since JDK1.1.4
*/
private int endMode;
@ -999,7 +1007,6 @@ public class SimpleTimeZone extends TimeZone {
* Typically one hour (3600000); sometimes 30 minutes (1800000).
* <p>If <code>useDaylight</code> is false, this value is ignored.
* @serial
* @since JDK1.1.4
*/
private int dstSavings;
@ -1060,7 +1067,6 @@ public class SimpleTimeZone extends TimeZone {
* and the highest allowable <code>serialVersionOnStream</code>
* is written.
* @serial
* @since JDK1.1.4
*/
private int serialVersionOnStream = currentSerialVersion;

View file

@ -70,14 +70,14 @@ import java.util.Vector;
* @see Calendar
* @see GregorianCalendar
* @see SimpleTimeZone
* @version 1.51 01/19/00
* @author Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
* @since JDK1.1
* @stable
*/
abstract public class TimeZone implements Serializable, Cloneable {
/**
* Sole constructor. (For invocation by subclass constructors, typically
* implicit.)
* @stable
*/
public TimeZone() {
}
@ -86,7 +86,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* A style specifier for <code>getDisplayName()</code> indicating
* a short name, such as "PST."
* @see #LONG
* @since 1.2
* @stable
*/
public static final int SHORT = 0;
@ -94,7 +94,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* A style specifier for <code>getDisplayName()</code> indicating
* a long name, such as "Pacific Standard Time."
* @see #SHORT
* @since 1.2
* @stable
*/
public static final int LONG = 1;
@ -122,6 +122,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param dayOfWeek the day-of-week of the given date.
* @param milliseconds the millis in day in <em>standard</em> local time.
* @return the offset to add *to* GMT to get local time.
* @stable
*/
abstract public int getOffset(int era, int year, int month, int day,
int dayOfWeek, int milliseconds);
@ -169,6 +170,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* Sets the base time zone offset to GMT.
* This is the offset to add *to* UTC to get local time.
* @param offsetMillis the given base time zone offset to GMT.
* @stable
*/
abstract public void setRawOffset(int offsetMillis);
@ -176,12 +178,14 @@ abstract public class TimeZone implements Serializable, Cloneable {
* Gets unmodified offset, NOT modified in case of daylight savings.
* This is the offset to add *to* UTC to get local time.
* @return the unmodified offset to add *to* UTC to get local time.
* @stable
*/
abstract public int getRawOffset();
/**
* Gets the ID of this time zone.
* @return the ID of this time zone.
* @stable
*/
public String getID()
{
@ -192,6 +196,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* Sets the time zone ID. This does not change any other data in
* the time zone object.
* @param ID the new time zone ID.
* @stable
*/
public void setID(String ID)
{
@ -209,7 +214,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* then this method returns a string in the format
* <code>GMT[+-]hh:mm</code>.
* @return the human-readable name of this time zone in the default locale.
* @since 1.2
* @stable
*/
public final String getDisplayName() {
return getDisplayName(false, LONG, Locale.getDefault());
@ -225,7 +230,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param locale the locale in which to supply the display name.
* @return the human-readable name of this time zone in the given locale
* or in the default locale if the given locale is not recognized.
* @since 1.2
* @stable
*/
public final String getDisplayName(Locale locale) {
return getDisplayName(false, LONG, locale);
@ -240,7 +245,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param daylight if true, return the daylight savings name.
* @param style either <code>LONG</code> or <code>SHORT</code>
* @return the human-readable name of this time zone in the default locale.
* @since 1.2
* @stable
*/
public final String getDisplayName(boolean daylight, int style) {
return getDisplayName(daylight, style, Locale.getDefault());
@ -258,7 +263,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @return the human-readable name of this time zone in the given locale
* or in the default locale if the given locale is not recognized.
* @exception IllegalArgumentException style is invalid.
* @since 1.2
* @stable
*/
public String getDisplayName(boolean daylight, int style, Locale locale) {
/* NOTES:
@ -311,6 +316,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* Queries if this time zone uses daylight savings time.
* @return true if this time zone uses daylight savings time,
* false, otherwise.
* @stable
*/
abstract public boolean useDaylightTime();
@ -320,6 +326,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param date the given Date.
* @return true if the given date is in daylight savings time,
* false, otherwise.
* @stable
*/
abstract public boolean inDaylightTime(Date date);
@ -333,6 +340,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
*
* @return the specified <code>TimeZone</code>, or the GMT zone if the given ID
* cannot be understood.
* @stable
*/
public static synchronized TimeZone getTimeZone(String ID) {
/* We first try to lookup the zone ID in our hashtable. If this fails,
@ -358,6 +366,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param rawOffset the offset in milliseconds from GMT
* @return an array of IDs for system TimeZones with the given
* raw offset. If there are none, return a zero-length array.
* @stable
*/
public static String[] getAvailableIDs(int rawOffset) {
return TimeZoneData.getAvailableIDs(rawOffset);
@ -372,6 +381,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* to return zones not associated with any country
* @return an array of IDs for system TimeZones in the given
* country. If there are none, return a zero-length array.
* @stable
*/
public static String[] getAvailableIDs(String country) {
return TimeZoneData.getAvailableIDs(country);
@ -383,6 +393,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* <code>get()</code> to construct the corresponding TimeZone
* object.
* @return an array of all system TimeZone IDs
* @stable
*/
public static String[] getAvailableIDs() {
return TimeZoneData.getAvailableIDs();
@ -400,6 +411,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @return the number of zones in the equivalency group containing
* 'id', or zero if 'id' is not a valid system ID
* @see #getEquivalentID
* @stable
*/
public static int countEquivalentIDs(String id) {
return TimeZoneData.countEquivalentIDs(id);
@ -422,6 +434,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* containing 'id', or an empty string if 'id' is not a valid
* system ID or 'index' is out of range
* @see #countEquivalentIDs
* @stable
*/
public static String getEquivalentID(String id, int index) {
return TimeZoneData.getEquivalentID(id, index);
@ -438,6 +451,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* The source of the default <code>TimeZone</code>
* may vary with implementation.
* @return a default <code>TimeZone</code>.
* @stable
*/
public static synchronized TimeZone getDefault() {
if (defaultZone == null) {
@ -503,6 +517,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* is null, reset the default to the value it had originally when the
* VM first started.
* @param zone the new default time zone
* @stable
*/
public static synchronized void setDefault(TimeZone zone)
{
@ -523,7 +538,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
* @param other the <code>TimeZone</code> object to be compared with
* @return true if the other zone is not null and is the same as this one,
* with the possible exception of the ID
* @since 1.2
* @stable
*/
public boolean hasSameRules(TimeZone other) {
return other != null && getRawOffset() == other.getRawOffset() &&
@ -532,6 +547,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
/**
* Overrides Cloneable
* @stable
*/
public Object clone()
{