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.
GenericAxisPosFormatter

java.lang.Object
  |
  +--ncsa.horizon.coordinates.formatters.GenericAxisPosFormatter
Subclasses:
MetricAxisPosFormatter

public class GenericAxisPosFormatter
extends java.lang.Object
implements AxisPosFormatter, GenericAxisPosFormatter.Modes
support for printing out double values as floating point numbers.

See Also:
Serialized Form

Inner Class Summary
static  GenericAxisPosFormatter.Modes
          the formatting modes
 
Field Summary
ScientificFormat fmt
          the format object used to do the actual formatting
static java.lang.String myname
           
 
Constructor Summary
GenericAxisPosFormatter()
           
 
Method Summary
java.lang.Object clone()
           
java.text.Format getFormat()
          return the format object used to format this object.
int getPrecision()
          return the number of significant digits that will be displayed to the right of the decimal place.
static void main(java.lang.String[] args)
           
void setMode(int mode)
          set the mode of the format
void setPrecision(int precision)
          set the number of significant digits to the right of the decimal place.
java.lang.String toString(double val)
          return a value as a string with a specified precision
java.lang.String toString(double val, int prec)
          return a value as a string with a specified precision
java.lang.String toString()
           
double valueOf(java.lang.String s)
          parse the String representation of a floating point number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

fmt

protected ScientificFormat fmt
the format object used to do the actual formatting

myname

protected static final java.lang.String myname
Constructor Detail

GenericAxisPosFormatter

public GenericAxisPosFormatter()
Method Detail

toString

public java.lang.String toString(double val)
return a value as a string with a specified precision
Specified by:
toString in interface AxisPosFormatter
Parameters:
val - the input value

toString

public java.lang.String toString(double val,
                       int prec)
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

valueOf

public double valueOf(java.lang.String s)
              throws java.lang.NumberFormatException
parse the String representation of a floating point number. The input can be in either decimal or exponential format, regardless of the current mode.
Specified by:
valueOf in interface AxisPosFormatter

setPrecision

public void setPrecision(int precision)
set the number of significant digits to the right of the decimal place. The sign of the input value is ignored.
Specified by:
setPrecision in interface AxisPosFormatter

getPrecision

public int getPrecision()
return the number of significant digits that will be displayed to the right of the decimal place.

setMode

public void setMode(int mode)
set the mode of the format

getFormat

public java.text.Format getFormat()
return the format object used to format this object. In this implementation, the returned object will be of type ncsa.horizon.util.ScientificFormat.

clone

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

main

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

toString

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

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