|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.text.Format
java.text.NumberFormat
astro.Convert
public class Convert
Class containing several conversion routines often used in astronomical context.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.text.NumberFormat |
|---|
NumberFormat.Field |
| Field Summary | |
|---|---|
static String[] |
CONST
|
private int |
digit
|
private String |
dstr
|
private String |
mstr
|
private double |
mult
|
private String |
sstr
|
| Fields inherited from class java.text.NumberFormat |
|---|
FRACTION_FIELD, INTEGER_FIELD |
| Constructor Summary | |
|---|---|
Convert()
|
|
Convert(boolean hours)
|
|
Convert(String h,
String m,
String s,
int dig,
boolean hour)
|
|
| Method Summary | |
|---|---|
static double |
convertDec(String dec)
Transforms ggdmm'ss" into the appropriate double value. |
static double |
convertHour(String hour)
Converts a xxhxxmxx.xs String into a double of the approbiate value. |
static double |
convertSexagesimal(String angle,
String d,
String m,
String s)
Converts a string from sexagesimal notation into a fractional angle. |
StringBuffer |
format(double angle,
StringBuffer append,
FieldPosition pos)
Formats the angle. |
StringBuffer |
format(long angle,
StringBuffer append,
FieldPosition pos)
Formats the angle. |
static String |
get99Catalog(int cat)
|
static int |
get99Catalog(String name)
|
static String |
getDec(double de)
Converts a double declination value into a xxdxx'xx.x" String. |
static String |
getHour(double rah)
Converts a double ra-h value into a xxhxxmxx.xs String. |
static String |
getSexagesimal(double ang,
String d,
String m,
String s,
int digit)
Converts an angle into the sexagesimal format. |
static String |
getSexagesimal(double ang,
String d,
String m,
String s,
int digit,
boolean full)
Converts an angle into the sexagesimal format. |
static void |
main(String[] arg)
|
Number |
parse(String source,
ParsePosition parsePosition)
Parses according to separators. |
| Methods inherited from class java.text.Format |
|---|
format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private String dstr
private String mstr
private String sstr
private int digit
private double mult
public static final String[] CONST
| Constructor Detail |
|---|
public Convert()
public Convert(boolean hours)
public Convert(String h,
String m,
String s,
int dig,
boolean hour)
| Method Detail |
|---|
public Number parse(String source,
ParsePosition parsePosition)
parse in class NumberFormat
public StringBuffer format(long angle,
StringBuffer append,
FieldPosition pos)
format in class NumberFormat
public StringBuffer format(double angle,
StringBuffer append,
FieldPosition pos)
format in class NumberFormatpublic static String getHour(double rah)
rah -
public static String getDec(double de)
public static String getSexagesimal(double ang,
String d,
String m,
String s,
int digit)
angle - The angle to be converted into sexagesimal.d - The degree-to-minute separator.m - The minutes-to-seconds separator.s - The String following the seconds.digit - The number of digits in the seconds, zero for integer.
public static String getSexagesimal(double ang,
String d,
String m,
String s,
int digit,
boolean full)
angle - The angle to be converted into sexagesimal.d - The degree-to-minute separator.m - The minutes-to-seconds separator.s - The String following the seconds.digit - The number of digits in the seconds, zero for integer.full - If true, minutes and seconds are added even if zero.public static double convertHour(String hour)
hour - A string of format ##h##m##.####s
public static double convertDec(String dec)
public static final double convertSexagesimal(String angle,
String d,
String m,
String s)
angle - The angle in sexagesimal notation.d - The separator string between degrees and minutes.m - The separator string between minutes and seconds.s - The last character, if any.public static int get99Catalog(String name)
name -
public static String get99Catalog(int cat)
cat -
public static void main(String[] arg)
arg -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||