|
KosherJava Zmanim Homepage Includes a dynamic Zmanim calendar generator |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.zmanim.util.GeoLocation
A class that contains location information such as latitude and longitude
required for astronomical calculations. The elevation field is not used by
most calculation engines and would be ignored if set. Check the documentation
for specific implementations of the AstronomicalCalculator
to see if
elevation is calculated as part o the algorithm.
Constructor Summary | |
GeoLocation()
Default GeoLocation constructor will set location to the Prime Meridian at Greenwich, England and a TimeZone of GMT. |
|
GeoLocation(String name,
double latitude,
double longitude,
double elevation,
TimeZone timeZone)
GeoLocation constructor with parameters for all required fields. |
|
GeoLocation(String name,
double latitude,
double longitude,
TimeZone timeZone)
GeoLocation constructor with parameters for all required fields. |
Method Summary | |
boolean |
equals(Object object)
|
double |
getElevation()
Method to get the elevation in Meters. |
double |
getLatitude()
|
String |
getLocationName()
|
double |
getLongitude()
|
TimeZone |
getTimeZone()
|
int |
hashCode()
|
void |
setElevation(double elevation)
Method to set the elevation in Meters above sea level. |
void |
setLatitude(double latitude)
Method to set the latitude in a double format. |
void |
setLatitude(int degrees,
int minutes,
double seconds,
String direction)
Method to set the latitude in degrees, minutes and seconds. |
void |
setLocationName(String name)
|
void |
setLongitude(double longitude)
Method to set the longitude in a double format. |
void |
setLongitude(int degrees,
int minutes,
double seconds,
String direction)
Method to set the longitude in degrees, minutes and seconds. |
void |
setTimeZone(TimeZone timeZone)
|
String |
toString()
|
String |
toXML()
A method that returns an XML formatted String representing
the serialized Object . |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GeoLocation(String name, double latitude, double longitude, TimeZone timeZone)
name
- The location name for display use such as "Lakewood,
NJ"latitude
- the latitude in a double format such as 40.095965 for Lakewood,
NJlongitude
- double the longitude in a double format such as -74.222130 for
Lakewood, NJ. timeZone
- the TimeZone
for the location.public GeoLocation(String name, double latitude, double longitude, double elevation, TimeZone timeZone)
name
- The location name for display use such as "Lakewood,
NJ"latitude
- the latitude in a double format such as 40.095965 for Lakewood,
NJlongitude
- double the longitude in a double format such as -74.222130 for
Lakewood, NJ. elevation
- the elevation above sea level in Meters. Elevation is not used
in most algorithms used for calculating sunrise and set.timeZone
- the TimeZone
for the location.public GeoLocation()
Method Detail |
public double getElevation()
public void setElevation(double elevation)
elevation
- The elevation to set in Meters. An IllegalArgumentException
will be thrown if the value is a negative.public void setLatitude(double latitude)
latitude
- The degrees of latitude to set in a double format between -90°
and 90°. An IllegalArgumentException will be thrown if the
value exceeds the limit. For example 40.095965 would be used for
Lakewood, NJ.public void setLatitude(int degrees, int minutes, double seconds, String direction)
degrees
- The degrees of latitude to set between -90 and 90. An
IllegalArgumentException will be thrown if the value exceeds
the limit. For example 40 would be used for Lakewood, NJ.minutes
- seconds
- direction
- N for north and S for south. An IllegalArgumentException will
be thrown if the value is not S or N.public double getLatitude()
public void setLongitude(double longitude)
longitude
- The degrees of longitude to set in a double format between
-180° and 180°. An IllegalArgumentException will be thrown if
the value exceeds the limit. For example -74.222130 would be
used for Lakewood, NJ. Note: for longitudes east of the Prime
Meridian (Greenwich) a negative value should be used.public void setLongitude(int degrees, int minutes, double seconds, String direction)
degrees
- The degrees of longitude to set between -180 and 180. An
IllegalArgumentException will be thrown if the value exceeds
the limit. For example -74 would be used for Lakewood, NJ.
Note: for longitudes east of the Prime
Meridian (Greenwich) a negative value should be used.minutes
- seconds
- direction
- E for east of the Prime Meridian or W for west of it. An
IllegalArgumentException will be thrown if the value is not E
or W.public double getLongitude()
public String getLocationName()
public void setLocationName(String name)
name
- The setter method for the display name.public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
timeZone
- The timeZone to set.public String toXML()
String
representing
the serialized Object
. Very similar to the toString
method but the return value is in an xml format. The format currently
used (subject to change) is:
<GeoLocation> <LocationName>Lakewood, NJ</LocationName> <Latitude>-74.222130°</Latitude> <Longitude>-74.222130°</Longitude> <Elevation>0 Meters</Elevation> <TimezoneName>America/New_York</TimezoneName> <TimeZoneDisplayName>Eastern Standard Time</TimeZoneDisplayName> <TimezoneGMTOffset>-5</TimezoneGMTOffset> <TimezoneDSTOffset>1</TimezoneDSTOffset> </GeoLocation>
String
.public boolean equals(Object object)
Object.equals(Object)
public int hashCode()
Object.hashCode()
public String toString()
Object.toString()
|
KosherJava Zmanim Homepage Includes a dynamic Zmanim calendar generator |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |