mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-2103 tag cleanup
X-SVN-Rev: 10474
This commit is contained in:
parent
99cb3d5c6d
commit
3b6e1e463e
11 changed files with 484 additions and 63 deletions
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/BuddhistCalendar.java,v $
|
||||
* $Date: 2002/10/02 20:20:25 $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2002/12/04 16:38:53 $
|
||||
* $Revision: 1.10 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -36,6 +36,7 @@ import java.util.Locale;
|
|||
*
|
||||
* @author Laura Werner
|
||||
* @author Alan Liu
|
||||
* @stable
|
||||
*/
|
||||
public class BuddhistCalendar extends GregorianCalendar {
|
||||
|
||||
|
@ -50,12 +51,14 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
* value for the Buddhist calendar.
|
||||
*
|
||||
* @see com.ibm.icu.util.Calendar#ERA
|
||||
* @stable
|
||||
*/
|
||||
public static final int BE = 0;
|
||||
|
||||
/**
|
||||
* Constructs a <code>BuddhistCalendar</code> using the current time
|
||||
* in the default time zone with the default locale.
|
||||
* @stable
|
||||
*/
|
||||
public BuddhistCalendar() {
|
||||
super();
|
||||
|
@ -66,6 +69,7 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
* in the given time zone with the default locale.
|
||||
*
|
||||
* @param zone the given time zone.
|
||||
* @stable
|
||||
*/
|
||||
public BuddhistCalendar(TimeZone zone) {
|
||||
super(zone);
|
||||
|
@ -76,6 +80,7 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
* in the default time zone with the given locale.
|
||||
*
|
||||
* @param aLocale the given locale.
|
||||
* @stable
|
||||
*/
|
||||
public BuddhistCalendar(Locale aLocale) {
|
||||
super(aLocale);
|
||||
|
@ -88,6 +93,7 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
* @param zone the given time zone.
|
||||
*
|
||||
* @param aLocale the given locale.
|
||||
* @stable
|
||||
*/
|
||||
public BuddhistCalendar(TimeZone zone, Locale aLocale) {
|
||||
super(zone, aLocale);
|
||||
|
@ -98,6 +104,7 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
* in the default time zone with the default locale.
|
||||
*
|
||||
* @param date The date to which the new calendar is set.
|
||||
* @stable
|
||||
*/
|
||||
public BuddhistCalendar(Date date) {
|
||||
this();
|
||||
|
@ -114,6 +121,7 @@ public class BuddhistCalendar 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} time field.
|
||||
* @stable
|
||||
*/
|
||||
public BuddhistCalendar(int year, int month, int date) {
|
||||
super(year, month, date);
|
||||
|
@ -135,6 +143,7 @@ public class BuddhistCalendar 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 BuddhistCalendar(int year, int month, int date, int hour,
|
||||
int minute, int second)
|
||||
|
@ -151,7 +160,10 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
|
||||
// Starts in -543 AD, ie 544 BC
|
||||
private static final int BUDDHIST_ERA_START = -543;
|
||||
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected int handleGetExtendedYear() {
|
||||
int year;
|
||||
if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) {
|
||||
|
@ -164,10 +176,16 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
}
|
||||
|
||||
// Return JD of start of given month/year
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
|
||||
return super.handleComputeMonthStart(eyear + BUDDHIST_ERA_START, month, useMonth);
|
||||
}
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected void handleComputeFields(int julianDay) {
|
||||
super.handleComputeFields(julianDay);
|
||||
int y = internalGet(EXTENDED_YEAR) - BUDDHIST_ERA_START;
|
||||
|
@ -180,6 +198,7 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
* Override GregorianCalendar. There is only one Buddhist ERA. We
|
||||
* should really handle YEAR, 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) {
|
||||
if (field == ERA) {
|
||||
|
@ -188,6 +207,7 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
return super.handleGetLimit(field, limitType);
|
||||
}
|
||||
|
||||
/*
|
||||
private static CalendarFactory factory;
|
||||
public static CalendarFactory factory() {
|
||||
if (factory == null) {
|
||||
|
@ -203,4 +223,5 @@ public class BuddhistCalendar extends GregorianCalendar {
|
|||
}
|
||||
return factory;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/CalendarAstronomer.java,v $
|
||||
* $Date: 2002/12/04 01:03:39 $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.9 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -46,6 +46,7 @@ import java.util.*;
|
|||
*
|
||||
* @author Laura Werner
|
||||
* @author Alan Liu
|
||||
* @stable
|
||||
*/
|
||||
public class CalendarAstronomer {
|
||||
|
||||
|
@ -56,12 +57,14 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* The number of standard hours in one sidereal day.
|
||||
* Approximately 24.93.
|
||||
* @stable
|
||||
*/
|
||||
public static final double SIDEREAL_DAY = 23.93446960027;
|
||||
|
||||
/**
|
||||
* The number of sidereal hours in one mean solar day.
|
||||
* Approximately 24.07.
|
||||
* @stable
|
||||
*/
|
||||
public static final double SOLAR_DAY = 24.065709816;
|
||||
|
||||
|
@ -73,6 +76,7 @@ public class CalendarAstronomer {
|
|||
* Approximately 29.53.
|
||||
*
|
||||
* @see #SIDEREAL_MONTH
|
||||
* @stable
|
||||
*/
|
||||
public static final double SYNODIC_MONTH = 29.530588853;
|
||||
|
||||
|
@ -85,6 +89,7 @@ public class CalendarAstronomer {
|
|||
* Approximately 27.32.
|
||||
*
|
||||
* @see #SYNODIC_MONTH
|
||||
* @stable
|
||||
*/
|
||||
public static final double SIDEREAL_MONTH = 27.32166;
|
||||
|
||||
|
@ -95,6 +100,7 @@ public class CalendarAstronomer {
|
|||
* Approximately 365.24
|
||||
*
|
||||
* @see #SIDEREAL_YEAR
|
||||
* @stable
|
||||
*/
|
||||
public static final double TROPICAL_YEAR = 365.242191;
|
||||
|
||||
|
@ -108,6 +114,7 @@ public class CalendarAstronomer {
|
|||
* Approximately 365.25.
|
||||
*
|
||||
* @see #TROPICAL_YEAR
|
||||
* @stable
|
||||
*/
|
||||
public static final double SIDEREAL_YEAR = 365.25636;
|
||||
|
||||
|
@ -115,16 +122,28 @@ public class CalendarAstronomer {
|
|||
// Time-related constants
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/** The number of milliseconds in one second. */
|
||||
/**
|
||||
* The number of milliseconds in one second.
|
||||
* @stable
|
||||
*/
|
||||
public static final int SECOND_MS = 1000;
|
||||
|
||||
/** The number of milliseconds in one minute. */
|
||||
/**
|
||||
* The number of milliseconds in one minute.
|
||||
* @stable
|
||||
*/
|
||||
public static final int MINUTE_MS = 60*SECOND_MS;
|
||||
|
||||
/** The number of milliseconds in one hour. */
|
||||
/**
|
||||
* The number of milliseconds in one hour.
|
||||
* @stable
|
||||
*/
|
||||
public static final int HOUR_MS = 60*MINUTE_MS;
|
||||
|
||||
/** The number of milliseconds in one day. */
|
||||
/**
|
||||
* The number of milliseconds in one day.
|
||||
* @stable
|
||||
*/
|
||||
public static final long DAY_MS = 24*HOUR_MS;
|
||||
|
||||
/**
|
||||
|
@ -134,6 +153,7 @@ public class CalendarAstronomer {
|
|||
* Note that julian day numbers and
|
||||
* the Julian calendar are <em>not</em> the same thing. Also note that
|
||||
* julian days start at <em>noon</em>, not midnight.
|
||||
* @stable
|
||||
*/
|
||||
public static final long JULIAN_EPOCH_MS = -210866760000000L;
|
||||
|
||||
|
@ -158,6 +178,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Construct a new <code>CalendarAstronomer</code> object that is initialized to
|
||||
* the current date and time.
|
||||
* @stable
|
||||
*/
|
||||
public CalendarAstronomer() {
|
||||
this(System.currentTimeMillis());
|
||||
|
@ -166,6 +187,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Construct a new <code>CalendarAstronomer</code> object that is initialized to
|
||||
* the specified date and time.
|
||||
* @stable
|
||||
*/
|
||||
public CalendarAstronomer(Date d) {
|
||||
this(d.getTime());
|
||||
|
@ -177,6 +199,7 @@ public class CalendarAstronomer {
|
|||
* January 1, 1970 AD (Gregorian).
|
||||
*
|
||||
* @see java.util.Date#getTime()
|
||||
* @stable
|
||||
*/
|
||||
public CalendarAstronomer(long aTime) {
|
||||
time = aTime;
|
||||
|
@ -194,6 +217,7 @@ public class CalendarAstronomer {
|
|||
* values signify North, negative South.
|
||||
*
|
||||
* @see java.util.Date#getTime()
|
||||
* @stable
|
||||
*/
|
||||
public CalendarAstronomer(double longitude, double latitude) {
|
||||
this();
|
||||
|
@ -216,6 +240,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see #setDate
|
||||
* @see #getTime
|
||||
* @stable
|
||||
*/
|
||||
public void setTime(long aTime) {
|
||||
time = aTime;
|
||||
|
@ -230,6 +255,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see #setTime
|
||||
* @see #getDate
|
||||
* @stable
|
||||
*/
|
||||
public void setDate(Date date) {
|
||||
setTime(date.getTime());
|
||||
|
@ -247,6 +273,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see #getJulianDay
|
||||
* @see #JULIAN_EPOCH_MS
|
||||
* @stable
|
||||
*/
|
||||
public void setJulianDay(double jdn) {
|
||||
time = (long)(jdn * DAY_MS) + JULIAN_EPOCH_MS;
|
||||
|
@ -261,6 +288,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see #setTime
|
||||
* @see #getDate
|
||||
* @stable
|
||||
*/
|
||||
public long getTime() {
|
||||
return time;
|
||||
|
@ -272,6 +300,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see #setDate
|
||||
* @see #getTime
|
||||
* @stable
|
||||
*/
|
||||
public Date getDate() {
|
||||
return new Date(time);
|
||||
|
@ -284,6 +313,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see #setJulianDay
|
||||
* @see #JULIAN_EPOCH_MS
|
||||
* @stable
|
||||
*/
|
||||
public double getJulianDay() {
|
||||
if (julianDay == INVALID) {
|
||||
|
@ -297,6 +327,7 @@ public class CalendarAstronomer {
|
|||
* the number of centuries after 1/1/1900 AD, 12:00 GMT
|
||||
*
|
||||
* @see #getJulianDay
|
||||
* @stable
|
||||
*/
|
||||
public double getJulianCentury() {
|
||||
if (julianCentury == INVALID) {
|
||||
|
@ -307,6 +338,7 @@ public class CalendarAstronomer {
|
|||
|
||||
/**
|
||||
* Returns the current Greenwich sidereal time, measured in hours
|
||||
* @stable
|
||||
*/
|
||||
public double getGreenwichSidereal() {
|
||||
if (siderealTime == INVALID) {
|
||||
|
@ -332,6 +364,7 @@ public class CalendarAstronomer {
|
|||
|
||||
/**
|
||||
* Returns the current local sidereal time, measured in hours
|
||||
* @stable
|
||||
*/
|
||||
public double getLocalSidereal() {
|
||||
return normalize(getGreenwichSidereal() + (double)fGmtOffset/HOUR_MS, 24);
|
||||
|
@ -369,6 +402,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @param ecliptic A point in the sky in ecliptic coordinates.
|
||||
* @return The corresponding point in equatorial coordinates.
|
||||
* @stable
|
||||
*/
|
||||
public final Equatorial eclipticToEquatorial(Ecliptic ecliptic)
|
||||
{
|
||||
|
@ -382,6 +416,7 @@ public class CalendarAstronomer {
|
|||
* @param eclipLat The ecliptic latitude
|
||||
*
|
||||
* @return The corresponding point in equatorial coordinates.
|
||||
* @stable
|
||||
*/
|
||||
public final Equatorial eclipticToEquatorial(double eclipLong, double eclipLat)
|
||||
{
|
||||
|
@ -409,13 +444,16 @@ public class CalendarAstronomer {
|
|||
* @param eclipLong The ecliptic longitude
|
||||
*
|
||||
* @return The corresponding point in equatorial coordinates.
|
||||
* @stable
|
||||
*/
|
||||
public final Equatorial eclipticToEquatorial(double eclipLong)
|
||||
{
|
||||
return eclipticToEquatorial(eclipLong, 0); // TODO: optimize
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
public Horizon eclipticToHorizon(double eclipLong)
|
||||
{
|
||||
Equatorial equatorial = eclipticToEquatorial(eclipLong);
|
||||
|
@ -461,6 +499,7 @@ public class CalendarAstronomer {
|
|||
* Currently, this method uses an approximation of the two-body Kepler's
|
||||
* equation for the earth and the sun. It does not take into account the
|
||||
* perturbations caused by the other planets, the moon, etc.
|
||||
* @stable
|
||||
*/
|
||||
public double getSunLongitude()
|
||||
{
|
||||
|
@ -488,6 +527,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* The position of the sun at this object's current date and time,
|
||||
* in equatorial coordinates.
|
||||
* @stable
|
||||
*/
|
||||
public Equatorial getSunPosition() {
|
||||
return eclipticToEquatorial(getSunLongitude(), 0);
|
||||
|
@ -502,6 +542,7 @@ public class CalendarAstronomer {
|
|||
* Constant representing the vernal equinox.
|
||||
* For use with {@link #getSunTime getSunTime}.
|
||||
* Note: In this case, "vernal" refers to the northern hemisphere's seasons.
|
||||
* @stable
|
||||
*/
|
||||
public static final SolarLongitude VERNAL_EQUINOX = new SolarLongitude(0);
|
||||
|
||||
|
@ -509,6 +550,7 @@ public class CalendarAstronomer {
|
|||
* Constant representing the summer solstice.
|
||||
* For use with {@link #getSunTime getSunTime}.
|
||||
* Note: In this case, "summer" refers to the northern hemisphere's seasons.
|
||||
* @stable
|
||||
*/
|
||||
public static final SolarLongitude SUMMER_SOLSTICE = new SolarLongitude(PI/2);
|
||||
|
||||
|
@ -516,6 +558,7 @@ public class CalendarAstronomer {
|
|||
* Constant representing the autumnal equinox.
|
||||
* For use with {@link #getSunTime getSunTime}.
|
||||
* Note: In this case, "autumn" refers to the northern hemisphere's seasons.
|
||||
* @stable
|
||||
*/
|
||||
public static final SolarLongitude AUTUMN_EQUINOX = new SolarLongitude(PI);
|
||||
|
||||
|
@ -523,12 +566,14 @@ public class CalendarAstronomer {
|
|||
* Constant representing the winter solstice.
|
||||
* For use with {@link #getSunTime getSunTime}.
|
||||
* Note: In this case, "winter" refers to the northern hemisphere's seasons.
|
||||
* @stable
|
||||
*/
|
||||
public static final SolarLongitude WINTER_SOLSTICE = new SolarLongitude((PI*3)/2);
|
||||
|
||||
/**
|
||||
* Find the next time at which the sun's ecliptic longitude will have
|
||||
* the desired value.
|
||||
* @stable
|
||||
*/
|
||||
public long getSunTime(double desired, boolean next)
|
||||
{
|
||||
|
@ -542,6 +587,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Find the next time at which the sun's ecliptic longitude will have
|
||||
* the desired value.
|
||||
* @stable
|
||||
*/
|
||||
public long getSunTime(SolarLongitude desired, boolean next) {
|
||||
return getSunTime(desired.value, next);
|
||||
|
@ -550,6 +596,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Returns the time (GMT) of sunrise or sunset on the local date to which
|
||||
* this calendar is currently set.
|
||||
* @stable
|
||||
*/
|
||||
public long getSunRiseSet(boolean rise)
|
||||
{
|
||||
|
@ -585,6 +632,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* The position of the moon at the time set on this
|
||||
* object, in equatorial coordinates.
|
||||
* @stable
|
||||
*/
|
||||
public Equatorial getMoonPosition()
|
||||
{
|
||||
|
@ -672,6 +720,7 @@ public class CalendarAstronomer {
|
|||
* measured in radians.
|
||||
*
|
||||
* @see #getMoonPhase
|
||||
* @stable
|
||||
*/
|
||||
public double getMoonAge() {
|
||||
// See page 147 of "Practial Astronomy with your Calculator",
|
||||
|
@ -697,6 +746,7 @@ public class CalendarAstronomer {
|
|||
* </ul>
|
||||
*
|
||||
* @see #getMoonAge
|
||||
* @stable
|
||||
*/
|
||||
public double getMoonPhase() {
|
||||
// See page 147 of "Practial Astronomy with your Calculator",
|
||||
|
@ -712,24 +762,28 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Constant representing a new moon.
|
||||
* For use with {@link #getMoonTime getMoonTime}
|
||||
* @stable
|
||||
*/
|
||||
public static final MoonAge NEW_MOON = new MoonAge(0);
|
||||
|
||||
/**
|
||||
* Constant representing the moon's first quarter.
|
||||
* For use with {@link #getMoonTime getMoonTime}
|
||||
* @stable
|
||||
*/
|
||||
public static final MoonAge FIRST_QUARTER = new MoonAge(PI/2);
|
||||
|
||||
/**
|
||||
* Constant representing a full moon.
|
||||
* For use with {@link #getMoonTime getMoonTime}
|
||||
* @stable
|
||||
*/
|
||||
public static final MoonAge FULL_MOON = new MoonAge(PI);
|
||||
|
||||
/**
|
||||
* Constant representing the moon's last quarter.
|
||||
* For use with {@link #getMoonTime getMoonTime}
|
||||
* @stable
|
||||
*/
|
||||
public static final MoonAge LAST_QUARTER = new MoonAge((PI*3)/2);
|
||||
|
||||
|
@ -740,6 +794,7 @@ public class CalendarAstronomer {
|
|||
* @param desired The desired longitude.
|
||||
* @param next <tt>true</tt> if the next occurrance of the phase
|
||||
* is desired, <tt>false</tt> for the previous occurrance.
|
||||
* @stable
|
||||
*/
|
||||
public long getMoonTime(double desired, boolean next)
|
||||
{
|
||||
|
@ -758,6 +813,7 @@ public class CalendarAstronomer {
|
|||
* @param desired The desired phase of the moon.
|
||||
* @param next <tt>true</tt> if the next occurrance of the phase
|
||||
* is desired, <tt>false</tt> for the previous occurrance.
|
||||
* @stable
|
||||
*/
|
||||
public long getMoonTime(MoonAge desired, boolean next) {
|
||||
return getMoonTime(desired.value, next);
|
||||
|
@ -766,6 +822,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Returns the time (GMT) of sunrise or sunset on the local date to which
|
||||
* this calendar is currently set.
|
||||
* @stable
|
||||
*/
|
||||
public long getMoonRiseSet(boolean rise)
|
||||
{
|
||||
|
@ -1037,6 +1094,10 @@ public class CalendarAstronomer {
|
|||
private static String hours(long ms) {
|
||||
return Double.toString((double)ms / HOUR_MS) + " hours";
|
||||
}
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
public String local(long localMillis) {
|
||||
return new Date(localMillis - TimeZone.getDefault().getRawOffset()).toString();
|
||||
}
|
||||
|
@ -1065,6 +1126,7 @@ public class CalendarAstronomer {
|
|||
* <p>
|
||||
* @param lat The ecliptic latitude, measured in radians.
|
||||
* @param lon The ecliptic longitude, measured in radians.
|
||||
* @stable
|
||||
*/
|
||||
public Ecliptic(double lat, double lon) {
|
||||
latitude = lat;
|
||||
|
@ -1073,6 +1135,7 @@ public class CalendarAstronomer {
|
|||
|
||||
/**
|
||||
* Return a string representation of this object
|
||||
* @stable
|
||||
*/
|
||||
public String toString() {
|
||||
return Double.toString(longitude*RAD_DEG) + "," + (latitude*RAD_DEG);
|
||||
|
@ -1082,6 +1145,7 @@ public class CalendarAstronomer {
|
|||
* The ecliptic latitude, in radians. This specifies an object's
|
||||
* position north or south of the plane of the ecliptic,
|
||||
* with positive angles representing north.
|
||||
* @stable
|
||||
*/
|
||||
public final double latitude;
|
||||
|
||||
|
@ -1094,6 +1158,7 @@ public class CalendarAstronomer {
|
|||
* <p>
|
||||
* A bit of trivia: the first point of Aries is currently in the
|
||||
* constellation Pisces, due to the precession of the earth's axis.
|
||||
* @stable
|
||||
*/
|
||||
public final double longitude;
|
||||
};
|
||||
|
@ -1112,6 +1177,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see CalendarAstronomer.Ecliptic
|
||||
* @see CalendarAstronomer.Horizon
|
||||
* @stable
|
||||
*/
|
||||
public static final class Equatorial {
|
||||
/**
|
||||
|
@ -1119,6 +1185,7 @@ public class CalendarAstronomer {
|
|||
* <p>
|
||||
* @param asc The right ascension, measured in radians.
|
||||
* @param dec The declination, measured in radians.
|
||||
* @stable
|
||||
*/
|
||||
public Equatorial(double asc, double dec) {
|
||||
ascension = asc;
|
||||
|
@ -1128,6 +1195,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Return a string representation of this object, with the
|
||||
* angles measured in degrees.
|
||||
* @stable
|
||||
*/
|
||||
public String toString() {
|
||||
return Double.toString(ascension*RAD_DEG) + "," + (declination*RAD_DEG);
|
||||
|
@ -1136,6 +1204,7 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Return a string representation of this object with the right ascension
|
||||
* measured in hours, minutes, and seconds.
|
||||
* @stable
|
||||
*/
|
||||
public String toHmsString() {
|
||||
return radToHms(ascension) + "," + radToDms(declination);
|
||||
|
@ -1146,6 +1215,7 @@ public class CalendarAstronomer {
|
|||
* This is the position east or west along the equator
|
||||
* relative to the sun's position at the vernal equinox,
|
||||
* with positive angles representing East.
|
||||
* @stable
|
||||
*/
|
||||
public final double ascension;
|
||||
|
||||
|
@ -1153,6 +1223,7 @@ public class CalendarAstronomer {
|
|||
* The declination, in radians.
|
||||
* This is the position north or south of the equatorial plane,
|
||||
* with positive angles representing north.
|
||||
* @stable
|
||||
*/
|
||||
public final double declination;
|
||||
};
|
||||
|
@ -1172,6 +1243,7 @@ public class CalendarAstronomer {
|
|||
*
|
||||
* @see CalendarAstronomer.Ecliptic
|
||||
* @see CalendarAstronomer.Equatorial
|
||||
* @stable
|
||||
*/
|
||||
public static final class Horizon {
|
||||
/**
|
||||
|
@ -1179,6 +1251,7 @@ public class CalendarAstronomer {
|
|||
* <p>
|
||||
* @param alt The altitude, measured in radians above the horizon.
|
||||
* @param azim The azimuth, measured in radians clockwise from north.
|
||||
* @stable
|
||||
*/
|
||||
public Horizon(double alt, double azim) {
|
||||
altitude = alt;
|
||||
|
@ -1188,15 +1261,22 @@ public class CalendarAstronomer {
|
|||
/**
|
||||
* Return a string representation of this object, with the
|
||||
* angles measured in degrees.
|
||||
* @stable
|
||||
*/
|
||||
public String toString() {
|
||||
return Double.toString(altitude*RAD_DEG) + "," + (azimuth*RAD_DEG);
|
||||
}
|
||||
|
||||
/** The object's altitude above the horizon, in radians. */
|
||||
/**
|
||||
* The object's altitude above the horizon, in radians.
|
||||
* @stable
|
||||
*/
|
||||
public final double altitude;
|
||||
|
||||
/** The object's direction, in radians clockwise from north. */
|
||||
/**
|
||||
* The object's direction, in radians clockwise from north.
|
||||
* @stable
|
||||
*/
|
||||
public final double azimuth;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/CalendarCache.java,v $
|
||||
* $Date: 2002/12/04 01:03:39 $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.6 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -125,6 +125,9 @@ public class CalendarCache
|
|||
|
||||
private long[] keys = new long[arraySize];
|
||||
private long[] values = new long[arraySize];
|
||||
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
static public long EMPTY = Long.MIN_VALUE;
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/DateRule.java,v $
|
||||
* $Date: 2002/02/16 03:06:27 $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -22,6 +22,7 @@ import java.util.Date;
|
|||
* Daylight Savings Time rules, and other events such as meetings.
|
||||
*
|
||||
* @see SimpleDateRule
|
||||
* @draft ICU 2.2
|
||||
*/
|
||||
public interface DateRule
|
||||
{
|
||||
|
@ -35,6 +36,7 @@ public interface DateRule
|
|||
* does not occur on or after the start date.
|
||||
*
|
||||
* @see #firstBetween
|
||||
* @draft ICU 2.2
|
||||
*/
|
||||
abstract public Date firstAfter(Date start);
|
||||
|
||||
|
@ -50,6 +52,7 @@ public interface DateRule
|
|||
* does not occur between the start and end dates.
|
||||
*
|
||||
* @see #firstAfter
|
||||
* @draft ICU 2.2
|
||||
*/
|
||||
abstract public Date firstBetween(Date start, Date end);
|
||||
|
||||
|
@ -62,13 +65,14 @@ public interface DateRule
|
|||
*
|
||||
* @param date The date to check.
|
||||
* @return true if this event occurs on the given date.
|
||||
*
|
||||
* @draft ICU 2.2
|
||||
*/
|
||||
abstract public boolean isOn(Date date);
|
||||
|
||||
/**
|
||||
* Check whether this event occurs at least once between the two
|
||||
* dates given.
|
||||
* @draft ICU 2.2
|
||||
*/
|
||||
abstract public boolean isBetween(Date start, Date end);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -546,7 +546,6 @@ public class GregorianCalendar extends Calendar {
|
|||
|
||||
/**
|
||||
* Roll a field by a signed amount.
|
||||
* @since 1.2
|
||||
* @stable
|
||||
*/
|
||||
public void roll(int field, int amount) {
|
||||
|
@ -616,7 +615,6 @@ 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) {
|
||||
|
@ -628,7 +626,6 @@ public class GregorianCalendar extends Calendar {
|
|||
* For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual
|
||||
* 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) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/HebrewCalendar.java,v $
|
||||
* $Date: 2002/12/04 01:03:39 $
|
||||
* $Revision: 1.11 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.12 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -75,47 +75,85 @@ public class HebrewCalendar extends Calendar {
|
|||
// Tons o' Constants...
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/** Constant for Tishri, the 1st month of the Hebrew year. @stable */
|
||||
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* Constant for Shevat, the 5th month of the Hebrew year.
|
||||
* @stable
|
||||
*/
|
||||
public static final int SHEVAT = 4;
|
||||
|
||||
/**
|
||||
* Constant for Adar I, the 6th month of the Hebrew year
|
||||
* (present in leap years only). In non-leap years, the calendar
|
||||
* jumps from Shevat (5th month) to Adar (7th month).
|
||||
* @stable
|
||||
*/
|
||||
public static final int ADAR_1 = 5;
|
||||
|
||||
/** Constant for the Adar, the 7th month of the Hebrew year. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* Constant for Elul, the 13th month of the Hebrew year.
|
||||
* @stable
|
||||
*/
|
||||
public static final int ELUL = 12;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/IslamicCalendar.java,v $
|
||||
* $Date: 2002/12/04 01:03:39 $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.14 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -82,40 +82,76 @@ public class IslamicCalendar extends Calendar {
|
|||
// Constants...
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/** Constant for Muharram, the 1st month of the Islamic year. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* 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. @stable */
|
||||
/**
|
||||
* Constant for Dhu al-Hijjah, the 12th month of the Islamic year.
|
||||
* @stable
|
||||
*/
|
||||
public static final int DHU_AL_HIJJAH = 11;
|
||||
|
||||
|
||||
|
@ -291,6 +327,9 @@ public class IslamicCalendar extends Calendar {
|
|||
{/* */}, // MILLISECONDS_IN_DAY
|
||||
};
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected int handleGetLimit(int field, int limitType) {
|
||||
return LIMITS[field][limitType];
|
||||
}
|
||||
|
@ -450,6 +489,7 @@ public class IslamicCalendar extends Calendar {
|
|||
*
|
||||
* @param year The hijri year
|
||||
* @param year The hijri month, 0-based
|
||||
* @stable
|
||||
*/
|
||||
protected int handleGetMonthLength(int extendedYear, int month) {
|
||||
|
||||
|
@ -469,6 +509,7 @@ public class IslamicCalendar extends Calendar {
|
|||
|
||||
/**
|
||||
* Return the number of days in the given Islamic year
|
||||
* @stable
|
||||
*/
|
||||
protected int handleGetYearLength(int extendedYear) {
|
||||
if (civil) {
|
||||
|
@ -484,6 +525,9 @@ public class IslamicCalendar extends Calendar {
|
|||
//-------------------------------------------------------------------------
|
||||
|
||||
// Return JD of start of given month/year
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
|
||||
return (int) monthStart(eyear, month) + 1948439;
|
||||
}
|
||||
|
@ -492,6 +536,9 @@ public class IslamicCalendar extends Calendar {
|
|||
// Functions for converting from milliseconds to field values
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected int handleGetExtendedYear() {
|
||||
int year;
|
||||
if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR) {
|
||||
|
@ -516,6 +563,7 @@ public class IslamicCalendar extends Calendar {
|
|||
* The DAY_OF_WEEK and DOW_LOCAL fields are already set when this
|
||||
* method is called. The getGregorianXxx() methods return Gregorian
|
||||
* calendar equivalents for the given Julian day.
|
||||
* @stable
|
||||
*/
|
||||
protected void handleComputeFields(int julianDay) {
|
||||
int year, month, dayOfMonth, dayOfYear;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/JapaneseCalendar.java,v $
|
||||
* $Date: 2002/12/04 01:03:39 $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.11 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -183,6 +183,9 @@ public class JapaneseCalendar extends GregorianCalendar {
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
protected int handleGetExtendedYear() {
|
||||
int year;
|
||||
// TODO reimplement this to be faster?
|
||||
|
@ -491,18 +494,33 @@ public class JapaneseCalendar extends GregorianCalendar {
|
|||
//-------------------------------------------------------------------------
|
||||
|
||||
// Constant for the current era. This must be regularly updated.
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
static public final int CURRENT_ERA = (ERAS.length / 3) - 1;
|
||||
|
||||
/** Constant for the era starting on Sept. 8, 1868 AD */
|
||||
/**
|
||||
* Constant for the era starting on Sept. 8, 1868 AD.
|
||||
* @stable
|
||||
*/
|
||||
static public final int MEIJI = CURRENT_ERA - 3;
|
||||
|
||||
/** Constant for the era starting on July 30, 1912 AD */
|
||||
/**
|
||||
* Constant for the era starting on July 30, 1912 AD.
|
||||
* @stable
|
||||
*/
|
||||
static public final int TAISHO = CURRENT_ERA - 2;
|
||||
|
||||
/** Constant for the era starting on Dec. 25, 1926 AD */
|
||||
/**
|
||||
* Constant for the era starting on Dec. 25, 1926 AD.
|
||||
* @stable
|
||||
*/
|
||||
static public final int SHOWA = CURRENT_ERA - 1;
|
||||
|
||||
/** Constant for the era starting on Jan. 7, 1989 AD */
|
||||
/**
|
||||
* Constant for the era starting on Jan. 7, 1989 AD.
|
||||
* @stable
|
||||
*/
|
||||
static public final int HEISEI = CURRENT_ERA;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/OverlayBundle.java,v $
|
||||
* $Date: 2002/08/13 23:43:27 $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2002/12/04 16:38:52 $
|
||||
* $Revision: 1.6 $
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -62,6 +62,7 @@ import java.util.*;
|
|||
*
|
||||
* @see java.util.ResourceBundle
|
||||
* @author Alan Liu
|
||||
* @internal
|
||||
*/
|
||||
// prepare to deprecate in next release
|
||||
///CLOVER:OFF
|
||||
|
@ -87,6 +88,7 @@ public class OverlayBundle extends ResourceBundle {
|
|||
/**
|
||||
* Construct an overlay bundle given a sequence of base names and
|
||||
* a locale.
|
||||
* @internal
|
||||
*/
|
||||
public OverlayBundle(String[] baseNames,
|
||||
Locale locale) {
|
||||
|
@ -98,6 +100,7 @@ public class OverlayBundle extends ResourceBundle {
|
|||
/**
|
||||
* ResourceBundle framework method. Delegates to
|
||||
* bundles[i].getObject().
|
||||
* @internal
|
||||
*/
|
||||
protected Object handleGetObject(String key)
|
||||
throws MissingResourceException {
|
||||
|
@ -124,6 +127,7 @@ public class OverlayBundle extends ResourceBundle {
|
|||
/**
|
||||
* ResourceBundle framework method. Delegates to
|
||||
* bundles[bundles.length-1].getKeys().
|
||||
* @internal
|
||||
*/
|
||||
public Enumeration getKeys() {
|
||||
// Return the enumeration of the last bundle, which is the base
|
||||
|
|
|
@ -675,6 +675,7 @@ public class SimpleTimeZone extends TimeZone {
|
|||
/**
|
||||
* Overrides TimeZone
|
||||
* Queries if the given date is in Daylight Savings Time.
|
||||
* @stable
|
||||
*/
|
||||
public boolean inDaylightTime(Date date)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue