Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class ncsa.horizon.coordinates.formatters.
DDMMSSAxisPosFormatter

java.lang.Object
  |
  +--ncsa.horizon.coordinates.formatters.DDMMSSAxisPosFormatter
Subclasses:
CDDMMSSAxisPosFormatter

public class DDMMSSAxisPosFormatter
extends java.lang.Object
implements AxisPosFormatter
support for printing out angles in degrees:minutes:seconds format

See Also:
Serialized Form

Field Summary
static int DEF_PREC
          default precision = 2. This is default number of digits to the right of the decimal in the seconds field
java.text.DecimalFormat fmt
          the format object used to format the seconds field
static int MAX_PREC
          the maximum precision supported = 16.
static java.lang.String myname
           
int prec
          the precision code
 
Constructor Summary
DDMMSSAxisPosFormatter()
           
 
Method Summary
java.lang.Object clone()
           
int getPrecision()
          return the currently set precision
static void main(java.lang.String[] args)
           
void setPrecision(int precision)
          set the precision of the output formatting
java.lang.String toString(double degrees, int precision)
          return a value as a string with a specified precision
java.lang.String toString(double degrees)
          format value into a string
java.lang.String toString()
           
double valueOf(java.lang.String s)
          parse a string for a double value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

DEF_PREC

public static final int DEF_PREC
default precision = 2. This is default number of digits to the right of the decimal in the seconds field

MAX_PREC

public static final int MAX_PREC
the maximum precision supported = 16.

fmt

protected java.text.DecimalFormat fmt
the format object used to format the seconds field

prec

protected int prec
the precision code

myname

protected static final java.lang.String myname
Constructor Detail

DDMMSSAxisPosFormatter

public DDMMSSAxisPosFormatter()
Method Detail

setPrecision

public void setPrecision(int precision)
set the precision of the output formatting
Specified by:
setPrecision in interface AxisPosFormatter
Parameters:
prec - the number of places right of the decimal point. Precision can have the following ranges:
    < -2   print default precision (2)
      -2   only the nearest hour should be printed.  
      -1   print value to the nearest minute.
       0   print value to the nearest second (with no decimal point).
    >= 1   print value with prec number of digits right of the
           decimal in the seconds field
 

getPrecision

public int getPrecision()
return the currently set precision

toString

public java.lang.String toString(double degrees,
                       int precision)
return a value as a string with a specified precision
Specified by:
toString in interface AxisPosFormatter
Parameters:
val - the input value
prec - the number of places right of the decimal point. Precision can have the following ranges:
    < 2   print with "natural" precision (whatever Java gives it)
      -2   only the nearest hour should be printed.  
      -1   print value to the nearest minute.
       0   print value to the nearest second (with no decimal point).
    >= 1   print value with prec number of digits right of the
           decimal in the seconds field
 

toString

public java.lang.String toString(double degrees)
format value into a string
Specified by:
toString in interface AxisPosFormatter

valueOf

public double valueOf(java.lang.String s)
              throws java.lang.NumberFormatException
parse a string for a double value.
Specified by:
valueOf in interface AxisPosFormatter

clone

public java.lang.Object clone()
Description copied from interface:
 
Specified by:
clone in interface AxisPosFormatter
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD