Java Doc for CalendarAstronomer.java in  » Internationalization-Localization » icu4j » com » ibm » icu » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Internationalization Localization » icu4j » com.ibm.icu.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.icu.impl.CalendarAstronomer

CalendarAstronomer
public class CalendarAstronomer (Code)
CalendarAstronomer is a class that can perform the calculations to determine the positions of the sun and moon, the time of sunrise and sunset, and other astronomy-related data. The calculations it performs are in some cases quite complicated, and this utility class saves you the trouble of worrying about them.

The measurement of time is a very important part of astronomy. Because astronomical bodies are constantly in motion, observations are only valid at a given moment in time. Accordingly, each CalendarAstronomer object has a time property that determines the date and time for which its calculations are performed. You can set and retrieve this property with CalendarAstronomer.setDate setDate , CalendarAstronomer.getDate getDate and related methods.

Almost all of the calculations performed by this class, or by any astronomer, are approximations to various degrees of accuracy. The calculations in this class are mostly modelled after those described in the book Practical Astronomy With Your Calculator, by Peter J. Duffett-Smith, Cambridge University Press, 1990. This is an excellent book, and if you want a greater understanding of how these calculations are performed it a very good, readable starting point.

WARNING: This class is very early in its development, and it is highly likely that its API will change to some degree in the future. At the moment, it basically does just enough to support com.ibm.icu.util.IslamicCalendar and com.ibm.icu.util.ChineseCalendar .
author:
   Laura Werner
author:
   Alan Liu


Inner Class :final public static class Ecliptic
Inner Class :final public static class Equatorial
Inner Class :final public static class Horizon

Field Summary
final public static  SolarLongitudeAUTUMN_EQUINOX
     Constant representing the autumnal equinox.
final public static  longDAY_MS
     The number of milliseconds in one day.
final static  longEPOCH_2000_MS
     Milliseconds value for 0.0 January 2000 AD.
final public static  MoonAgeFIRST_QUARTER
     Constant representing the moon's first quarter.
final public static  MoonAgeFULL_MOON
     Constant representing a full moon.
final public static  intHOUR_MS
     The number of milliseconds in one hour.
final static  doubleJD_EPOCH
    
final public static  longJULIAN_EPOCH_MS
     The start of the julian day numbering scheme used by astronomers, which is 1/1/4713 BC (Julian), 12:00 GMT.
final public static  MoonAgeLAST_QUARTER
     Constant representing the moon's last quarter.
final public static  intMINUTE_MS
     The number of milliseconds in one minute.
final public static  MoonAgeNEW_MOON
     Constant representing a new moon.
final public static  intSECOND_MS
     The number of milliseconds in one second.
final public static  doubleSIDEREAL_DAY
     The number of standard hours in one sidereal day.
final public static  doubleSIDEREAL_MONTH
     The average number of days it takes for the moon to return to the same ecliptic longitude relative to the stellar background.
final public static  doubleSIDEREAL_YEAR
     The average number of days it takes for the sun to return to the same position against the fixed stellar background.
final public static  doubleSOLAR_DAY
     The number of sidereal hours in one mean solar day.
final public static  SolarLongitudeSUMMER_SOLSTICE
     Constant representing the summer solstice.
final static  doubleSUN_E
    
final static  doubleSUN_ETA_G
    
final static  doubleSUN_OMEGA_G
    
final public static  doubleSYNODIC_MONTH
     The average number of solar days from one new moon to the next.
final public static  doubleTROPICAL_YEAR
     The average number number of days between successive vernal equinoxes.
final public static  SolarLongitudeVERNAL_EQUINOX
     Constant representing the vernal equinox. For use with CalendarAstronomer.getSunTime(SolarLongitude,boolean) getSunTime .
final public static  SolarLongitudeWINTER_SOLSTICE
     Constant representing the winter solstice.
final static  doublemoonA
    
final static  doublemoonE
    
final static  doublemoonI
    
final static  doublemoonL0
    
final static  doublemoonN0
    
final static  doublemoonP0
    
final static  doublemoonPi
    
final static  doublemoonT0
    

Constructor Summary
public  CalendarAstronomer()
     Construct a new CalendarAstronomer object that is initialized to the current date and time.
public  CalendarAstronomer(Date d)
     Construct a new CalendarAstronomer object that is initialized to the specified date and time.
public  CalendarAstronomer(long aTime)
     Construct a new CalendarAstronomer object that is initialized to the specified time.
public  CalendarAstronomer(double longitude, double latitude)
     Construct a new CalendarAstronomer object with the given latitude and longitude.

Method Summary
final public  EquatorialeclipticToEquatorial(Ecliptic ecliptic)
     Convert from ecliptic to equatorial coordinates.
Parameters:
  ecliptic - A point in the sky in ecliptic coordinates.
final public  EquatorialeclipticToEquatorial(double eclipLong, double eclipLat)
     Convert from ecliptic to equatorial coordinates.
final public  EquatorialeclipticToEquatorial(double eclipLong)
     Convert from ecliptic longitude to equatorial coordinates.
public  HorizoneclipticToHorizon(double eclipLong)
    
public  DategetDate()
     Get the current time of this CalendarAstronomer object, represented as a Date object.
public  doublegetGreenwichSidereal()
    
public  doublegetJulianCentury()
    
public  doublegetJulianDay()
     Get the current time of this CalendarAstronomer object, expressed as a "julian day number", which is the number of elapsed days since 1/1/4713 BC (Julian), 12:00 GMT.
public  doublegetLocalSidereal()
    
public  doublegetMoonAge()
     The "age" of the moon at the time specified in this object.
public  doublegetMoonPhase()
     Calculate the phase of the moon at the time set in this object.
public  EquatorialgetMoonPosition()
     The position of the moon at the time set on this object, in equatorial coordinates.
public  longgetMoonRiseSet(boolean rise)
     Returns the time (GMT) of sunrise or sunset on the local date to which this calendar is currently set.
public  longgetMoonTime(double desired, boolean next)
     Find the next or previous time at which the Moon's ecliptic longitude will have the desired value.
public  longgetMoonTime(MoonAge desired, boolean next)
     Find the next or previous time at which the moon will be in the desired phase.


Parameters:
  desired - The desired phase of the moon.
Parameters:
  next - true if the next occurrance of the phaseis desired, false for the previous occurrance.

public  doublegetSunLongitude()
     The longitude of the sun at the time specified by this object. The longitude is measured in radians along the ecliptic from the "first point of Aries," the point at which the ecliptic crosses the earth's equatorial plane at the vernal equinox.

Currently, this method uses an approximation of the two-body Kepler's equation for the earth and the sun.

 double[]getSunLongitude(double julianDay)
     TODO Make this public when the entire class is package-private.
public  EquatorialgetSunPosition()
     The position of the sun at this object's current date and time, in equatorial coordinates.
public  longgetSunRiseSet(boolean rise)
     Returns the time (GMT) of sunrise or sunset on the local date to which this calendar is currently set. NOTE: This method only works well if this object is set to a time near local noon.
public  longgetSunTime(double desired, boolean next)
     Find the next time at which the sun's ecliptic longitude will have the desired value.
public  longgetSunTime(SolarLongitude desired, boolean next)
     Find the next time at which the sun's ecliptic longitude will have the desired value.
public  longgetTime()
     Get the current time of this CalendarAstronomer object, represented as the number of milliseconds since 1/1/1970 AD 0:00 GMT (Gregorian).
public  Stringlocal(long localMillis)
    
public  voidsetDate(Date date)
     Set the current date and time of this CalendarAstronomer object.
public  voidsetJulianDay(double jdn)
     Set the current date and time of this CalendarAstronomer object.
public  voidsetTime(long aTime)
     Set the current date and time of this CalendarAstronomer object.

Field Detail
AUTUMN_EQUINOX
final public static SolarLongitude AUTUMN_EQUINOX(Code)
Constant representing the autumnal equinox. For use with CalendarAstronomer.getSunTime(SolarLongitude,boolean) getSunTime . Note: In this case, "autumn" refers to the northern hemisphere's seasons.



DAY_MS
final public static long DAY_MS(Code)
The number of milliseconds in one day.



EPOCH_2000_MS
final static long EPOCH_2000_MS(Code)
Milliseconds value for 0.0 January 2000 AD.



FIRST_QUARTER
final public static MoonAge FIRST_QUARTER(Code)
Constant representing the moon's first quarter. For use with CalendarAstronomer.getMoonTime(MoonAge,boolean) getMoonTime



FULL_MOON
final public static MoonAge FULL_MOON(Code)
Constant representing a full moon. For use with CalendarAstronomer.getMoonTime(MoonAge,boolean) getMoonTime



HOUR_MS
final public static int HOUR_MS(Code)
The number of milliseconds in one hour.



JD_EPOCH
final static double JD_EPOCH(Code)



JULIAN_EPOCH_MS
final public static long JULIAN_EPOCH_MS(Code)
The start of the julian day numbering scheme used by astronomers, which is 1/1/4713 BC (Julian), 12:00 GMT. This is given as the number of milliseconds since 1/1/1970 AD (Gregorian), a negative number. Note that julian day numbers and the Julian calendar are not the same thing. Also note that julian days start at noon, not midnight.



LAST_QUARTER
final public static MoonAge LAST_QUARTER(Code)
Constant representing the moon's last quarter. For use with CalendarAstronomer.getMoonTime(MoonAge,boolean) getMoonTime



MINUTE_MS
final public static int MINUTE_MS(Code)
The number of milliseconds in one minute.



NEW_MOON
final public static MoonAge NEW_MOON(Code)
Constant representing a new moon. For use with CalendarAstronomer.getMoonTime(MoonAge,boolean) getMoonTime



SECOND_MS
final public static int SECOND_MS(Code)
The number of milliseconds in one second.



SIDEREAL_DAY
final public static double SIDEREAL_DAY(Code)
The number of standard hours in one sidereal day. Approximately 24.93.



SIDEREAL_MONTH
final public static double SIDEREAL_MONTH(Code)
The average number of days it takes for the moon to return to the same ecliptic longitude relative to the stellar background. This is referred to as the sidereal month. It is shorter than the synodic month due to the revolution of the earth around the sun. Approximately 27.32.
See Also:   CalendarAstronomer.SYNODIC_MONTH



SIDEREAL_YEAR
final public static double SIDEREAL_YEAR(Code)
The average number of days it takes for the sun to return to the same position against the fixed stellar background. This is the duration of one orbit of the earth about the sun as it would appear to an outside observer. Due to the precession of the earth's axis, this is not precisely the same as the tropical year. Approximately 365.25.
See Also:   CalendarAstronomer.TROPICAL_YEAR



SOLAR_DAY
final public static double SOLAR_DAY(Code)
The number of sidereal hours in one mean solar day. Approximately 24.07.



SUMMER_SOLSTICE
final public static SolarLongitude SUMMER_SOLSTICE(Code)
Constant representing the summer solstice. For use with CalendarAstronomer.getSunTime(SolarLongitude,boolean) getSunTime . Note: In this case, "summer" refers to the northern hemisphere's seasons.



SUN_E
final static double SUN_E(Code)



SUN_ETA_G
final static double SUN_ETA_G(Code)



SUN_OMEGA_G
final static double SUN_OMEGA_G(Code)



SYNODIC_MONTH
final public static double SYNODIC_MONTH(Code)
The average number of solar days from one new moon to the next. This is the time it takes for the moon to return the same ecliptic longitude as the sun. It is longer than the sidereal month because the sun's longitude increases during the year due to the revolution of the earth around the sun. Approximately 29.53.
See Also:   CalendarAstronomer.SIDEREAL_MONTH



TROPICAL_YEAR
final public static double TROPICAL_YEAR(Code)
The average number number of days between successive vernal equinoxes. Due to the precession of the earth's axis, this is not precisely the same as the sidereal year. Approximately 365.24
See Also:   CalendarAstronomer.SIDEREAL_YEAR



VERNAL_EQUINOX
final public static SolarLongitude VERNAL_EQUINOX(Code)
Constant representing the vernal equinox. For use with CalendarAstronomer.getSunTime(SolarLongitude,boolean) getSunTime . Note: In this case, "vernal" refers to the northern hemisphere's seasons.



WINTER_SOLSTICE
final public static SolarLongitude WINTER_SOLSTICE(Code)
Constant representing the winter solstice. For use with CalendarAstronomer.getSunTime(SolarLongitude,boolean) getSunTime . Note: In this case, "winter" refers to the northern hemisphere's seasons.



moonA
final static double moonA(Code)



moonE
final static double moonE(Code)



moonI
final static double moonI(Code)



moonL0
final static double moonL0(Code)



moonN0
final static double moonN0(Code)



moonP0
final static double moonP0(Code)



moonPi
final static double moonPi(Code)



moonT0
final static double moonT0(Code)




Constructor Detail
CalendarAstronomer
public CalendarAstronomer()(Code)
Construct a new CalendarAstronomer object that is initialized to the current date and time.



CalendarAstronomer
public CalendarAstronomer(Date d)(Code)
Construct a new CalendarAstronomer object that is initialized to the specified date and time.



CalendarAstronomer
public CalendarAstronomer(long aTime)(Code)
Construct a new CalendarAstronomer object that is initialized to the specified time. The time is expressed as a number of milliseconds since January 1, 1970 AD (Gregorian).
See Also:   java.util.Date.getTime



CalendarAstronomer
public CalendarAstronomer(double longitude, double latitude)(Code)
Construct a new CalendarAstronomer object with the given latitude and longitude. The object's time is set to the current date and time.


Parameters:
  longitude - The desired longitude, in degrees east ofthe Greenwich meridian.
Parameters:
  latitude - The desired latitude, in degrees. Positivevalues signify North, negative South.
See Also:   java.util.Date.getTime





Method Detail
eclipticToEquatorial
final public Equatorial eclipticToEquatorial(Ecliptic ecliptic)(Code)
Convert from ecliptic to equatorial coordinates.
Parameters:
  ecliptic - A point in the sky in ecliptic coordinates. The corresponding point in equatorial coordinates.



eclipticToEquatorial
final public Equatorial eclipticToEquatorial(double eclipLong, double eclipLat)(Code)
Convert from ecliptic to equatorial coordinates.
Parameters:
  eclipLong - The ecliptic longitude
Parameters:
  eclipLat - The ecliptic latitude The corresponding point in equatorial coordinates.



eclipticToEquatorial
final public Equatorial eclipticToEquatorial(double eclipLong)(Code)
Convert from ecliptic longitude to equatorial coordinates.
Parameters:
  eclipLong - The ecliptic longitude The corresponding point in equatorial coordinates.



eclipticToHorizon
public Horizon eclipticToHorizon(double eclipLong)(Code)



getDate
public Date getDate()(Code)
Get the current time of this CalendarAstronomer object, represented as a Date object.
See Also:   CalendarAstronomer.setDate
See Also:   CalendarAstronomer.getTime



getGreenwichSidereal
public double getGreenwichSidereal()(Code)
Returns the current Greenwich sidereal time, measured in hours



getJulianCentury
public double getJulianCentury()(Code)
Return this object's time expressed in julian centuries: the number of centuries after 1/1/1900 AD, 12:00 GMT
See Also:   CalendarAstronomer.getJulianDay



getJulianDay
public double getJulianDay()(Code)
Get the current time of this CalendarAstronomer object, expressed as a "julian day number", which is the number of elapsed days since 1/1/4713 BC (Julian), 12:00 GMT.
See Also:   CalendarAstronomer.setJulianDay
See Also:   CalendarAstronomer.JULIAN_EPOCH_MS



getLocalSidereal
public double getLocalSidereal()(Code)
Returns the current local sidereal time, measured in hours



getMoonAge
public double getMoonAge()(Code)
The "age" of the moon at the time specified in this object. This is really the angle between the current ecliptic longitudes of the sun and the moon, measured in radians.
See Also:   CalendarAstronomer.getMoonPhase



getMoonPhase
public double getMoonPhase()(Code)
Calculate the phase of the moon at the time set in this object. The returned phase is a double in the range 0 <= phase < 1, interpreted as follows:
  • 0.00: New moon
  • 0.25: First quarter
  • 0.50: Full moon
  • 0.75: Last quarter

See Also:   CalendarAstronomer.getMoonAge



getMoonPosition
public Equatorial getMoonPosition()(Code)
The position of the moon at the time set on this object, in equatorial coordinates.



getMoonRiseSet
public long getMoonRiseSet(boolean rise)(Code)
Returns the time (GMT) of sunrise or sunset on the local date to which this calendar is currently set.



getMoonTime
public long getMoonTime(double desired, boolean next)(Code)
Find the next or previous time at which the Moon's ecliptic longitude will have the desired value.


Parameters:
  desired - The desired longitude.
Parameters:
  next - true if the next occurrance of the phaseis desired, false for the previous occurrance.




getMoonTime
public long getMoonTime(MoonAge desired, boolean next)(Code)
Find the next or previous time at which the moon will be in the desired phase.


Parameters:
  desired - The desired phase of the moon.
Parameters:
  next - true if the next occurrance of the phaseis desired, false for the previous occurrance.




getSunLongitude
public double getSunLongitude()(Code)
The longitude of the sun at the time specified by this object. The longitude is measured in radians along the ecliptic from the "first point of Aries," the point at which the ecliptic crosses the earth's equatorial plane at the vernal equinox.

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.




getSunLongitude
double[] getSunLongitude(double julianDay)(Code)
TODO Make this public when the entire class is package-private.



getSunPosition
public Equatorial getSunPosition()(Code)
The position of the sun at this object's current date and time, in equatorial coordinates.



getSunRiseSet
public long getSunRiseSet(boolean rise)(Code)
Returns the time (GMT) of sunrise or sunset on the local date to which this calendar is currently set. NOTE: This method only works well if this object is set to a time near local noon. Because of variations between the local official time zone and the geographic longitude, the computation can flop over into an adjacent day if this object is set to a time near local midnight.



getSunTime
public long getSunTime(double desired, boolean next)(Code)
Find the next time at which the sun's ecliptic longitude will have the desired value.



getSunTime
public long getSunTime(SolarLongitude desired, boolean next)(Code)
Find the next time at which the sun's ecliptic longitude will have the desired value.



getTime
public long getTime()(Code)
Get the current time of this CalendarAstronomer object, represented as the number of milliseconds since 1/1/1970 AD 0:00 GMT (Gregorian).
See Also:   CalendarAstronomer.setTime
See Also:   CalendarAstronomer.getDate



local
public String local(long localMillis)(Code)



setDate
public void setDate(Date date)(Code)
Set the current date and time of this CalendarAstronomer object. All astronomical calculations are performed based on this time setting.
Parameters:
  date - the time and date, expressed as a Date object.
See Also:   CalendarAstronomer.setTime
See Also:   CalendarAstronomer.getDate



setJulianDay
public void setJulianDay(double jdn)(Code)
Set the current date and time of this CalendarAstronomer object. All astronomical calculations are performed based on this time setting.
Parameters:
  jdn - the desired time, expressed as a "julian day number",which is the number of elapsed days since 1/1/4713 BC (Julian), 12:00 GMT. Note that julian daynumbers start at noon. To get the jdn forthe corresponding midnight, subtract 0.5.
See Also:   CalendarAstronomer.getJulianDay
See Also:   CalendarAstronomer.JULIAN_EPOCH_MS



setTime
public void setTime(long aTime)(Code)
Set the current date and time of this CalendarAstronomer object. All astronomical calculations are performed based on this time setting.
Parameters:
  aTime - the date and time, expressed as the number of milliseconds since1/1/1970 0:00 GMT (Gregorian).
See Also:   CalendarAstronomer.setDate
See Also:   CalendarAstronomer.getTime



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.