|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.measure.EquatorialArc<Latitude> edu.nrao.sss.measure.Latitude
public class Latitude
The latitudinal coordinate of a point on a sphere.
The other coordinate is Longitude
.
The major usage of this class is as a declination. See Wikipedia for an explanation of declination.
Version Info:
$Revision: 161 $ |
$Date: 2006-12-15 18:48:34 +0000 (Fri, 15 Dec 2006) $ |
$Author: btruitt $ (last person to update) |
Constructor Summary | |
---|---|
Latitude()
Creates a new latitude of 0.0 degrees. |
|
Latitude(Angle latitude)
Creates a new latitude from the given angle. |
|
Latitude(BigDecimal degrees)
Creates a new latitude of degrees degrees. |
|
Latitude(BigDecimal magnitude,
ArcUnits units)
Creates a new latitude with the given magnitude and units. |
|
Latitude(String degrees)
Creates a new latitude of degrees degrees. |
|
Latitude(String magnitude,
ArcUnits units)
Creates a new latitude with the given magnitude and units. |
Method Summary | |
---|---|
boolean |
getIncreasesNorthward()
Returns true if latitude increases when traveling north. |
boolean |
isEquator()
Returns true if this latitude is the equator. |
boolean |
isNorthOf(Latitude other)
Returns true if this latitude is north of other . |
boolean |
isNorthOfEquator()
Returns true if this latitude is north of the equator. |
boolean |
isNorthPole()
Returns true if this latitude is the north pole. |
boolean |
isPole()
Returns true if this latitude is one of the poles. |
boolean |
isSouthOf(Latitude other)
Returns true if this latitude is south of other . |
boolean |
isSouthOfEquator()
Returns true if this latitude is south of the equator. |
boolean |
isSouthPole()
Returns true if this latitude is the north pole. |
static Latitude |
parse(String text)
Returns a new latitude based on the given text. |
void |
reset()
Resets this latitude so that it is equal to a latitude created via the no-argument constructor. |
void |
set(String text)
Sets the value and units of this latitude base on the given text. |
void |
setIncreasesNorthward(boolean northIsUp)
Configures the directional convention for this latitude. |
String |
toString(String separator)
Returns a string where the degrees, minutes, and seconds are separated by the given string. |
String |
toString(String separator,
int minFracDigits,
int maxFracDigits)
Returns a string where the degrees, minutes, and seconds are separated by the given string. |
Methods inherited from class edu.nrao.sss.measure.EquatorialArc |
---|
add, add, add, add, add, add, clone, compareTo, convertTo, equals, getUnits, getValue, hashCode, set, set, subtract, subtract, subtract, subtract, subtract, subtract, toAngle, toDms, toHms, toString, toString, toStringDms, toStringDms, toStringDmsHtml, toStringHms, toStringHms, toUnits |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Latitude()
public Latitude(Angle latitude)
latitude
- an angle of latitude.
NullPointerException
- if latitude is nullpublic Latitude(BigDecimal degrees)
degrees
degrees.
If degrees
is not a valid value1 for
latitude, it will be normalized in a way that will
transform it to a legal value.
1 To be legal, degrees
must be greater
than or equal to -90.0 and less than or equal to +90.0.
public Latitude(String degrees)
degrees
degrees.
If degrees
is not a valid value1 for
latitude, it will be normalized in a way that will
transform it to a legal value.
1 To be legal, degrees
must be greater
than or equal to -90.0 and less than or equal to +90.0.
public Latitude(BigDecimal magnitude, ArcUnits units)
magnitude
is not a valid value1 for
latitude, it will be normalized in a way that will
transform it to a legal value.
1 To be legal, magnitude
must be greater
than or equal to the negative of one-quarter of a circle and
less than or equal to one-quarter of a circle, in the given
units.
public Latitude(String magnitude, ArcUnits units)
magnitude
is not a valid value1 for
latitude, it will be normalized in a way that will
transform it to a legal value.
1 To be legal, magnitude
must be greater
than or equal to the negative of one-quarter of a circle and
less than or equal to one-quarter of a circle, in the given
units.
Method Detail |
---|
public void reset()
public void setIncreasesNorthward(boolean northIsUp)
northIsUp
is true, then latitude values become
more positive in a northward direction. If it is false, then they
become more positive in a southward direction.
northIsUp
- true if latitude increases when traveling north.public boolean getIncreasesNorthward()
public boolean isNorthOf(Latitude other)
other
.
other
- the latitude to be tested.
other
.public boolean isSouthOf(Latitude other)
other
.
other
- the latitude to be tested.
other
.public boolean isNorthOfEquator()
public boolean isSouthOfEquator()
public boolean isPole()
public boolean isNorthPole()
public boolean isSouthPole()
public boolean isEquator()
public String toString(String separator)
separator
- the separator to use between the degrees and minutes,
and minutes and seconds, fields.
public String toString(String separator, int minFracDigits, int maxFracDigits)
separator
- the separator to use between the degrees and minutes,
and minutes and seconds, fields.minFracDigits
- the minimum number of places after the decimal point
for the seconds field.maxFracDigits
- the maximum number of places after the decimal point
for the seconds field.
public static Latitude parse(String text)
See the parse
method of Angle
for information on the format of
text
. This Latitude
class offers two other
formats:
The parsed value, if not a legal value for latitude, will be
normalized in such a way that it is transformed to a legal value.
To be legal, magnitude
must be greater
than or equal to the negative of one-quarter of a circle and
less than or equal to one-quarter of a circle, in the given
units.
text
- a string that will be converted into a latitude.
IllegalArgumentException
- if text
is not in
the expected form.public void set(String text)
parse(String)
for the expected format of
text
.
See the parse
method of Angle
for information on the format of
text
.
The parsed value, if not a legal value for latitude, will be
normalized in such a way that it is transformed to a legal value.
To be legal, magnitude
must be greater
than or equal to the negative of one-quarter of a circle and
less than or equal to one-quarter of a circle, in the given
units.
text
- a string that will be converted into
a latitude.
IllegalArgumentException
- if text
is not in
the expected form.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |