michael@0: /************************************************************************
michael@0: * Copyright (C) 1996-2008, International Business Machines Corporation *
michael@0: * and others. All Rights Reserved. *
michael@0: ************************************************************************
michael@0: * 2003-nov-07 srl Port from Java
michael@0: */
michael@0:
michael@0: #ifndef ASTRO_H
michael@0: #define ASTRO_H
michael@0:
michael@0: #include "unicode/utypes.h"
michael@0:
michael@0: #if !UCONFIG_NO_FORMATTING
michael@0:
michael@0: #include "gregoimp.h" // for Math
michael@0: #include "unicode/unistr.h"
michael@0:
michael@0: U_NAMESPACE_BEGIN
michael@0:
michael@0: /**
michael@0: * CalendarAstronomer
is a class that can perform the calculations to
michael@0: * determine the positions of the sun and moon, the time of sunrise and
michael@0: * sunset, and other astronomy-related data. The calculations it performs
michael@0: * are in some cases quite complicated, and this utility class saves you
michael@0: * the trouble of worrying about them.
michael@0: *
michael@0: * The measurement of time is a very important part of astronomy. Because
michael@0: * astronomical bodies are constantly in motion, observations are only valid
michael@0: * at a given moment in time. Accordingly, each CalendarAstronomer
michael@0: * object has a time
property that determines the date
michael@0: * and time for which its calculations are performed. You can set and
michael@0: * retrieve this property with {@link #setDate setDate}, {@link #getDate getDate}
michael@0: * and related methods.
michael@0: *
michael@0: * Almost all of the calculations performed by this class, or by any michael@0: * astronomer, are approximations to various degrees of accuracy. The michael@0: * calculations in this class are mostly modelled after those described michael@0: * in the book michael@0: * michael@0: * Practical Astronomy With Your Calculator, by Peter J. michael@0: * Duffett-Smith, Cambridge University Press, 1990. This is an excellent michael@0: * book, and if you want a greater understanding of how these calculations michael@0: * are performed it a very good, readable starting point. michael@0: *
michael@0: * WARNING: This class is very early in its development, and michael@0: * it is highly likely that its API will change to some degree in the future. michael@0: * At the moment, it basically does just enough to support {@link IslamicCalendar} michael@0: * and {@link ChineseCalendar}. michael@0: * michael@0: * @author Laura Werner michael@0: * @author Alan Liu michael@0: * @internal michael@0: */ michael@0: class U_I18N_API CalendarAstronomer : public UMemory { michael@0: public: michael@0: // some classes michael@0: michael@0: public: michael@0: /** michael@0: * Represents the position of an object in the sky relative to the ecliptic, michael@0: * the plane of the earth's orbit around the Sun. michael@0: * This is a spherical coordinate system in which the latitude michael@0: * specifies the position north or south of the plane of the ecliptic. michael@0: * The longitude specifies the position along the ecliptic plane michael@0: * relative to the "First Point of Aries", which is the Sun's position in the sky michael@0: * at the Vernal Equinox. michael@0: *
michael@0: * Note that Ecliptic objects are immutable and cannot be modified michael@0: * once they are constructed. This allows them to be passed and returned by michael@0: * value without worrying about whether other code will modify them. michael@0: * michael@0: * @see CalendarAstronomer.Equatorial michael@0: * @see CalendarAstronomer.Horizon michael@0: * @internal michael@0: */ michael@0: class U_I18N_API Ecliptic : public UMemory { michael@0: public: michael@0: /** michael@0: * Constructs an Ecliptic coordinate object. michael@0: *
michael@0: * @param lat The ecliptic latitude, measured in radians. michael@0: * @param lon The ecliptic longitude, measured in radians. michael@0: * @internal michael@0: */ michael@0: Ecliptic(double lat = 0, double lon = 0) { michael@0: latitude = lat; michael@0: longitude = lon; michael@0: } michael@0: michael@0: /** michael@0: * Setter for Ecliptic Coordinate object michael@0: * @param lat The ecliptic latitude, measured in radians. michael@0: * @param lon The ecliptic longitude, measured in radians. michael@0: * @internal michael@0: */ michael@0: void set(double lat, double lon) { michael@0: latitude = lat; michael@0: longitude = lon; michael@0: } michael@0: michael@0: /** michael@0: * Return a string representation of this object michael@0: * @internal michael@0: */ michael@0: UnicodeString toString() const; michael@0: michael@0: /** michael@0: * The ecliptic latitude, in radians. This specifies an object's michael@0: * position north or south of the plane of the ecliptic, michael@0: * with positive angles representing north. michael@0: * @internal michael@0: */ michael@0: double latitude; michael@0: michael@0: /** michael@0: * The ecliptic longitude, in radians. michael@0: * This specifies an object's position along the ecliptic plane michael@0: * relative to the "First Point of Aries", which is the Sun's position michael@0: * in the sky at the Vernal Equinox, michael@0: * with positive angles representing east. michael@0: *
michael@0: * A bit of trivia: the first point of Aries is currently in the michael@0: * constellation Pisces, due to the precession of the earth's axis. michael@0: * @internal michael@0: */ michael@0: double longitude; michael@0: }; michael@0: michael@0: /** michael@0: * Represents the position of an michael@0: * object in the sky relative to the plane of the earth's equator. michael@0: * The Right Ascension specifies the position east or west michael@0: * along the equator, relative to the sun's position at the vernal michael@0: * equinox. The Declination is the position north or south michael@0: * of the equatorial plane. michael@0: *
michael@0: * Note that Equatorial objects are immutable and cannot be modified michael@0: * once they are constructed. This allows them to be passed and returned by michael@0: * value without worrying about whether other code will modify them. michael@0: * michael@0: * @see CalendarAstronomer.Ecliptic michael@0: * @see CalendarAstronomer.Horizon michael@0: * @internal michael@0: */ michael@0: class U_I18N_API Equatorial : public UMemory { michael@0: public: michael@0: /** michael@0: * Constructs an Equatorial coordinate object. michael@0: *
michael@0: * @param asc The right ascension, measured in radians. michael@0: * @param dec The declination, measured in radians. michael@0: * @internal michael@0: */ michael@0: Equatorial(double asc = 0, double dec = 0) michael@0: : ascension(asc), declination(dec) { } michael@0: michael@0: /** michael@0: * Setter michael@0: * @param asc The right ascension, measured in radians. michael@0: * @param dec The declination, measured in radians. michael@0: * @internal michael@0: */ michael@0: void set(double asc, double dec) { michael@0: ascension = asc; michael@0: declination = dec; michael@0: } michael@0: michael@0: /** michael@0: * Return a string representation of this object, with the michael@0: * angles measured in degrees. michael@0: * @internal michael@0: */ michael@0: UnicodeString toString() const; michael@0: michael@0: /** michael@0: * Return a string representation of this object with the right ascension michael@0: * measured in hours, minutes, and seconds. michael@0: * @internal michael@0: */ michael@0: //String toHmsString() { michael@0: //return radToHms(ascension) + "," + radToDms(declination); michael@0: //} michael@0: michael@0: /** michael@0: * The right ascension, in radians. michael@0: * This is the position east or west along the equator michael@0: * relative to the sun's position at the vernal equinox, michael@0: * with positive angles representing East. michael@0: * @internal michael@0: */ michael@0: double ascension; michael@0: michael@0: /** michael@0: * The declination, in radians. michael@0: * This is the position north or south of the equatorial plane, michael@0: * with positive angles representing north. michael@0: * @internal michael@0: */ michael@0: double declination; michael@0: }; michael@0: michael@0: /** michael@0: * Represents the position of an object in the sky relative to michael@0: * the local horizon. michael@0: * The Altitude represents the object's elevation above the horizon, michael@0: * with objects below the horizon having a negative altitude. michael@0: * The Azimuth is the geographic direction of the object from the michael@0: * observer's position, with 0 representing north. The azimuth increases michael@0: * clockwise from north. michael@0: *
michael@0: * Note that Horizon objects are immutable and cannot be modified michael@0: * once they are constructed. This allows them to be passed and returned by michael@0: * value without worrying about whether other code will modify them. michael@0: * michael@0: * @see CalendarAstronomer.Ecliptic michael@0: * @see CalendarAstronomer.Equatorial michael@0: * @internal michael@0: */ michael@0: class U_I18N_API Horizon : public UMemory { michael@0: public: michael@0: /** michael@0: * Constructs a Horizon coordinate object. michael@0: *
michael@0: * @param alt The altitude, measured in radians above the horizon.
michael@0: * @param azim The azimuth, measured in radians clockwise from north.
michael@0: * @internal
michael@0: */
michael@0: Horizon(double alt=0, double azim=0)
michael@0: : altitude(alt), azimuth(azim) { }
michael@0:
michael@0: /**
michael@0: * Setter for Ecliptic Coordinate object
michael@0: * @param alt The altitude, measured in radians above the horizon.
michael@0: * @param azim The azimuth, measured in radians clockwise from north.
michael@0: * @internal
michael@0: */
michael@0: void set(double alt, double azim) {
michael@0: altitude = alt;
michael@0: azimuth = azim;
michael@0: }
michael@0:
michael@0: /**
michael@0: * Return a string representation of this object, with the
michael@0: * angles measured in degrees.
michael@0: * @internal
michael@0: */
michael@0: UnicodeString toString() const;
michael@0:
michael@0: /**
michael@0: * The object's altitude above the horizon, in radians.
michael@0: * @internal
michael@0: */
michael@0: double altitude;
michael@0:
michael@0: /**
michael@0: * The object's direction, in radians clockwise from north.
michael@0: * @internal
michael@0: */
michael@0: double azimuth;
michael@0: };
michael@0:
michael@0: public:
michael@0: //-------------------------------------------------------------------------
michael@0: // Assorted private data used for conversions
michael@0: //-------------------------------------------------------------------------
michael@0:
michael@0: // My own copies of these so compilers are more likely to optimize them away
michael@0: static const double PI;
michael@0:
michael@0: /**
michael@0: * The average number of solar days from one new moon to the next. This is the time
michael@0: * it takes for the moon to return the same ecliptic longitude as the sun.
michael@0: * It is longer than the sidereal month because the sun's longitude increases
michael@0: * during the year due to the revolution of the earth around the sun.
michael@0: * Approximately 29.53.
michael@0: *
michael@0: * @see #SIDEREAL_MONTH
michael@0: * @internal
michael@0: * @deprecated ICU 2.4. This class may be removed or modified.
michael@0: */
michael@0: static const double SYNODIC_MONTH;
michael@0:
michael@0: //-------------------------------------------------------------------------
michael@0: // Constructors
michael@0: //-------------------------------------------------------------------------
michael@0:
michael@0: /**
michael@0: * Construct a new CalendarAstronomer
object that is initialized to
michael@0: * the current date and time.
michael@0: * @internal
michael@0: */
michael@0: CalendarAstronomer();
michael@0:
michael@0: /**
michael@0: * Construct a new CalendarAstronomer
object that is initialized to
michael@0: * the specified date and time.
michael@0: * @internal
michael@0: */
michael@0: CalendarAstronomer(UDate d);
michael@0:
michael@0: /**
michael@0: * Construct a new CalendarAstronomer
object with the given
michael@0: * latitude and longitude. The object's time is set to the current
michael@0: * date and time.
michael@0: *
michael@0: * @param longitude The desired longitude, in degrees east of
michael@0: * the Greenwich meridian.
michael@0: *
michael@0: * @param latitude The desired latitude, in degrees. Positive
michael@0: * values signify North, negative South.
michael@0: *
michael@0: * @see java.util.Date#getTime()
michael@0: * @internal
michael@0: */
michael@0: CalendarAstronomer(double longitude, double latitude);
michael@0:
michael@0: /**
michael@0: * Destructor
michael@0: * @internal
michael@0: */
michael@0: ~CalendarAstronomer();
michael@0:
michael@0: //-------------------------------------------------------------------------
michael@0: // Time and date getters and setters
michael@0: //-------------------------------------------------------------------------
michael@0:
michael@0: /**
michael@0: * Set the current date and time of this CalendarAstronomer
object. All
michael@0: * astronomical calculations are performed based on this time setting.
michael@0: *
michael@0: * @param aTime the date and time, expressed as the number of milliseconds since
michael@0: * 1/1/1970 0:00 GMT (Gregorian).
michael@0: *
michael@0: * @see #setDate
michael@0: * @see #getTime
michael@0: * @internal
michael@0: */
michael@0: void setTime(UDate aTime);
michael@0:
michael@0:
michael@0: /**
michael@0: * Set the current date and time of this CalendarAstronomer
object. All
michael@0: * astronomical calculations are performed based on this time setting.
michael@0: *
michael@0: * @param aTime the date and time, expressed as the number of milliseconds since
michael@0: * 1/1/1970 0:00 GMT (Gregorian).
michael@0: *
michael@0: * @see #getTime
michael@0: * @internal
michael@0: */
michael@0: void setDate(UDate aDate) { setTime(aDate); }
michael@0:
michael@0: /**
michael@0: * Set the current date and time of this CalendarAstronomer
object. All
michael@0: * astronomical calculations are performed based on this time setting.
michael@0: *
michael@0: * @param jdn the desired time, expressed as a "julian day number",
michael@0: * which is the number of elapsed days since
michael@0: * 1/1/4713 BC (Julian), 12:00 GMT. Note that julian day
michael@0: * numbers start at noon. To get the jdn for
michael@0: * the corresponding midnight, subtract 0.5.
michael@0: *
michael@0: * @see #getJulianDay
michael@0: * @see #JULIAN_EPOCH_MS
michael@0: * @internal
michael@0: */
michael@0: void setJulianDay(double jdn);
michael@0:
michael@0: /**
michael@0: * Get the current time of this CalendarAstronomer
object,
michael@0: * represented as the number of milliseconds since
michael@0: * 1/1/1970 AD 0:00 GMT (Gregorian).
michael@0: *
michael@0: * @see #setTime
michael@0: * @see #getDate
michael@0: * @internal
michael@0: */
michael@0: UDate getTime();
michael@0:
michael@0: /**
michael@0: * Get the current time of this CalendarAstronomer
object,
michael@0: * expressed as a "julian day number", which is the number of elapsed
michael@0: * days since 1/1/4713 BC (Julian), 12:00 GMT.
michael@0: *
michael@0: * @see #setJulianDay
michael@0: * @see #JULIAN_EPOCH_MS
michael@0: * @internal
michael@0: */
michael@0: double getJulianDay();
michael@0:
michael@0: /**
michael@0: * Return this object's time expressed in julian centuries:
michael@0: * the number of centuries after 1/1/1900 AD, 12:00 GMT
michael@0: *
michael@0: * @see #getJulianDay
michael@0: * @internal
michael@0: */
michael@0: double getJulianCentury();
michael@0:
michael@0: /**
michael@0: * Returns the current Greenwich sidereal time, measured in hours
michael@0: * @internal
michael@0: */
michael@0: double getGreenwichSidereal();
michael@0:
michael@0: private:
michael@0: double getSiderealOffset();
michael@0: public:
michael@0: /**
michael@0: * Returns the current local sidereal time, measured in hours
michael@0: * @internal
michael@0: */
michael@0: double getLocalSidereal();
michael@0:
michael@0: /**
michael@0: * Converts local sidereal time to Universal Time.
michael@0: *
michael@0: * @param lst The Local Sidereal Time, in hours since sidereal midnight
michael@0: * on this object's current date.
michael@0: *
michael@0: * @return The corresponding Universal Time, in milliseconds since
michael@0: * 1 Jan 1970, GMT.
michael@0: */
michael@0: //private:
michael@0: double lstToUT(double lst);
michael@0:
michael@0: /**
michael@0: *
michael@0: * Convert from ecliptic to equatorial coordinates.
michael@0: *
michael@0: * @param ecliptic The ecliptic
michael@0: * @param result Fillin result
michael@0: * @return reference to result
michael@0: */
michael@0: Equatorial& eclipticToEquatorial(Equatorial& result, const Ecliptic& ecliptic);
michael@0:
michael@0: /**
michael@0: * Convert from ecliptic to equatorial coordinates.
michael@0: *
michael@0: * @param eclipLong The ecliptic longitude
michael@0: * @param eclipLat The ecliptic latitude
michael@0: *
michael@0: * @return The corresponding point in equatorial coordinates.
michael@0: * @internal
michael@0: */
michael@0: Equatorial& eclipticToEquatorial(Equatorial& result, double eclipLong, double eclipLat);
michael@0:
michael@0: /**
michael@0: * Convert from ecliptic longitude to equatorial coordinates.
michael@0: *
michael@0: * @param eclipLong The ecliptic longitude
michael@0: *
michael@0: * @return The corresponding point in equatorial coordinates.
michael@0: * @internal
michael@0: */
michael@0: Equatorial& eclipticToEquatorial(Equatorial& result, double eclipLong) ;
michael@0:
michael@0: /**
michael@0: * @internal
michael@0: */
michael@0: Horizon& eclipticToHorizon(Horizon& result, double eclipLong) ;
michael@0:
michael@0: //-------------------------------------------------------------------------
michael@0: // The Sun
michael@0: //-------------------------------------------------------------------------
michael@0:
michael@0: /**
michael@0: * The longitude of the sun at the time specified by this object.
michael@0: * The longitude is measured in radians along the ecliptic
michael@0: * from the "first point of Aries," the point at which the ecliptic
michael@0: * crosses the earth's equatorial plane at the vernal equinox.
michael@0: *
michael@0: * Currently, this method uses an approximation of the two-body Kepler's
michael@0: * equation for the earth and the sun. It does not take into account the
michael@0: * perturbations caused by the other planets, the moon, etc.
michael@0: * @internal
michael@0: */
michael@0: double getSunLongitude();
michael@0:
michael@0: /**
michael@0: * TODO Make this public when the entire class is package-private.
michael@0: */
michael@0: /*public*/ void getSunLongitude(double julianDay, double &longitude, double &meanAnomaly);
michael@0:
michael@0: /**
michael@0: * The position of the sun at this object's current date and time,
michael@0: * in equatorial coordinates.
michael@0: * @param result fillin for the result
michael@0: * @internal
michael@0: */
michael@0: Equatorial& getSunPosition(Equatorial& result);
michael@0:
michael@0: public:
michael@0: /**
michael@0: * Constant representing the vernal equinox.
michael@0: * For use with {@link #getSunTime getSunTime}.
michael@0: * Note: In this case, "vernal" refers to the northern hemisphere's seasons.
michael@0: * @internal
michael@0: */
michael@0: // static double VERNAL_EQUINOX();
michael@0:
michael@0: /**
michael@0: * Constant representing the summer solstice.
michael@0: * For use with {@link #getSunTime getSunTime}.
michael@0: * Note: In this case, "summer" refers to the northern hemisphere's seasons.
michael@0: * @internal
michael@0: */
michael@0: static double SUMMER_SOLSTICE();
michael@0:
michael@0: /**
michael@0: * Constant representing the autumnal equinox.
michael@0: * For use with {@link #getSunTime getSunTime}.
michael@0: * Note: In this case, "autumn" refers to the northern hemisphere's seasons.
michael@0: * @internal
michael@0: */
michael@0: // static double AUTUMN_EQUINOX();
michael@0:
michael@0: /**
michael@0: * Constant representing the winter solstice.
michael@0: * For use with {@link #getSunTime getSunTime}.
michael@0: * Note: In this case, "winter" refers to the northern hemisphere's seasons.
michael@0: * @internal
michael@0: */
michael@0: static double WINTER_SOLSTICE();
michael@0:
michael@0: /**
michael@0: * Find the next time at which the sun's ecliptic longitude will have
michael@0: * the desired value.
michael@0: * @internal
michael@0: */
michael@0: UDate getSunTime(double desired, UBool next);
michael@0:
michael@0: /**
michael@0: * Returns the time (GMT) of sunrise or sunset on the local date to which
michael@0: * this calendar is currently set.
michael@0: *
michael@0: * NOTE: This method only works well if this object is set to a
michael@0: * time near local noon. Because of variations between the local
michael@0: * official time zone and the geographic longitude, the
michael@0: * computation can flop over into an adjacent day if this object
michael@0: * is set to a time near local midnight.
michael@0: *
michael@0: * @internal
michael@0: */
michael@0: UDate getSunRiseSet(UBool rise);
michael@0:
michael@0: //-------------------------------------------------------------------------
michael@0: // The Moon
michael@0: //-------------------------------------------------------------------------
michael@0:
michael@0: /**
michael@0: * The position of the moon at the time set on this
michael@0: * object, in equatorial coordinates.
michael@0: * @internal
michael@0: * @return const reference to internal field of calendar astronomer. Do not use outside of the lifetime of this astronomer.
michael@0: */
michael@0: const Equatorial& getMoonPosition();
michael@0:
michael@0: /**
michael@0: * The "age" of the moon at the time specified in this object.
michael@0: * This is really the angle between the
michael@0: * current ecliptic longitudes of the sun and the moon,
michael@0: * measured in radians.
michael@0: *
michael@0: * @see #getMoonPhase
michael@0: * @internal
michael@0: */
michael@0: double getMoonAge();
michael@0:
michael@0: /**
michael@0: * Calculate the phase of the moon at the time set in this object.
michael@0: * The returned phase is a double
in the range
michael@0: * 0 <= phase < 1
, interpreted as follows:
michael@0: *
michael@0: * @param desired The desired longitude. michael@0: * @param next true if the next occurrance of the phase michael@0: * is desired, false for the previous occurrance. michael@0: * @internal michael@0: */ michael@0: UDate getMoonTime(double desired, UBool next); michael@0: UDate getMoonTime(const MoonAge& desired, UBool next); michael@0: michael@0: /** michael@0: * Returns the time (GMT) of sunrise or sunset on the local date to which michael@0: * this calendar is currently set. michael@0: * @internal michael@0: */ michael@0: UDate getMoonRiseSet(UBool rise); michael@0: michael@0: //------------------------------------------------------------------------- michael@0: // Interpolation methods for finding the time at which a given event occurs michael@0: //------------------------------------------------------------------------- michael@0: michael@0: // private michael@0: class AngleFunc : public UMemory { michael@0: public: michael@0: virtual double eval(CalendarAstronomer&) = 0; michael@0: virtual ~AngleFunc(); michael@0: }; michael@0: friend class AngleFunc; michael@0: michael@0: UDate timeOfAngle(AngleFunc& func, double desired, michael@0: double periodDays, double epsilon, UBool next); michael@0: michael@0: class CoordFunc : public UMemory { michael@0: public: michael@0: virtual void eval(Equatorial& result, CalendarAstronomer&) = 0; michael@0: virtual ~CoordFunc(); michael@0: }; michael@0: friend class CoordFunc; michael@0: michael@0: double riseOrSet(CoordFunc& func, UBool rise, michael@0: double diameter, double refraction, michael@0: double epsilon); michael@0: michael@0: //------------------------------------------------------------------------- michael@0: // Other utility methods michael@0: //------------------------------------------------------------------------- michael@0: private: michael@0: michael@0: /** michael@0: * Return the obliquity of the ecliptic (the angle between the ecliptic michael@0: * and the earth's equator) at the current time. This varies due to michael@0: * the precession of the earth's axis. michael@0: * michael@0: * @return the obliquity of the ecliptic relative to the equator, michael@0: * measured in radians. michael@0: */ michael@0: double eclipticObliquity(); michael@0: michael@0: //------------------------------------------------------------------------- michael@0: // Private data michael@0: //------------------------------------------------------------------------- michael@0: private: michael@0: /** michael@0: * Current time in milliseconds since 1/1/1970 AD michael@0: * @see java.util.Date#getTime michael@0: */ michael@0: UDate fTime; michael@0: michael@0: /* These aren't used yet, but they'll be needed for sunset calculations michael@0: * and equatorial to horizon coordinate conversions michael@0: */ michael@0: double fLongitude; michael@0: double fLatitude; michael@0: double fGmtOffset; michael@0: michael@0: // michael@0: // The following fields are used to cache calculated results for improved michael@0: // performance. These values all depend on the current time setting michael@0: // of this object, so the clearCache method is provided. michael@0: // michael@0: michael@0: double julianDay; michael@0: double julianCentury; michael@0: double sunLongitude; michael@0: double meanAnomalySun; michael@0: double moonLongitude; michael@0: double moonEclipLong; michael@0: double meanAnomalyMoon; michael@0: double eclipObliquity; michael@0: double siderealT0; michael@0: double siderealTime; michael@0: michael@0: void clearCache(); michael@0: michael@0: Equatorial moonPosition; michael@0: UBool moonPositionSet; michael@0: michael@0: /** michael@0: * @internal michael@0: */ michael@0: // UDate local(UDate localMillis); michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: struct UHashtable; michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: /** michael@0: * Cache of month -> julian day michael@0: * @internal michael@0: */ michael@0: class CalendarCache : public UMemory { michael@0: public: michael@0: static int32_t get(CalendarCache** cache, int32_t key, UErrorCode &status); michael@0: static void put(CalendarCache** cache, int32_t key, int32_t value, UErrorCode &status); michael@0: virtual ~CalendarCache(); michael@0: private: michael@0: CalendarCache(int32_t size, UErrorCode& status); michael@0: static void createCache(CalendarCache** cache, UErrorCode& status); michael@0: /** michael@0: * not implemented michael@0: */ michael@0: CalendarCache(); michael@0: UHashtable *fTable; michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif michael@0: #endif