org.jscience.astronomy.solarsystem.coordinates
Class CoordinateFormatter

java.lang.Object
  extended by org.jscience.astronomy.solarsystem.coordinates.CoordinateFormatter

public class CoordinateFormatter
extends java.lang.Object


Constructor Summary
CoordinateFormatter()
           
 
Method Summary
 java.lang.String decimal(double value, int precision)
           
 java.lang.String format(double value, int precision)
           
static void main(java.lang.String[] args)
           
 void setSeparators(java.lang.String[] separators)
           
 void setSexagesimal(boolean flag)
           
 void setZeroFill(boolean flag)
           
 java.lang.String sexagesimal(double value, int precision)
          Create a sexagesimal string representing the coordinate value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinateFormatter

public CoordinateFormatter()
Method Detail

sexagesimal

public java.lang.String sexagesimal(double value,
                                    int precision)
Create a sexagesimal string representing the coordinate value.

Parameters:
value - A double precision value which is to be converted to a string representation. The user should convert to hours prior to this call if the string is to be in hours.
precision - A integer value giving the precision to which the value is to be shown.
Less than 3
Degrees (or hours), e.g. 24
3
Deg.f e.g., 24.3
4
Deg mm e.g., 24 18
5
Deg mm.f e.g., 25 18.3
6
Deg mm ss e.g., 25 18 18
7
Deg mm ss.s e.g., 25 18 18.2
8
Deg mm ss.ss e.g., 25 18 18.24
Greater than 8
Deg mm ss.sss e.g., 25 18 18.238

decimal

public java.lang.String decimal(double value,
                                int precision)

setZeroFill

public void setZeroFill(boolean flag)

setSexagesimal

public void setSexagesimal(boolean flag)

setSeparators

public void setSeparators(java.lang.String[] separators)

format

public java.lang.String format(double value,
                               int precision)

main

public static void main(java.lang.String[] args)