org.das2.datum.format
Class ExponentialDatumFormatter
java.lang.Object
org.das2.datum.format.DatumFormatter
org.das2.datum.format.ExponentialDatumFormatter
public class ExponentialDatumFormatter
- extends DatumFormatter
Formats Datums forcing a given exponent and number of decimal places.
This is useful for axes where each of the labels should have the same
exponent. Zero is treated specially, just "0" is returned. This helps
one to quickly identify zero on the axis.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ExponentialDatumFormatter
public ExponentialDatumFormatter(int digits,
int exponent)
format
public java.lang.String format(Datum datum)
- Specified by:
format
in class DatumFormatter
format
public java.lang.String format(Datum datum,
Units units)
- Overrides:
format
in class DatumFormatter
grannyFormat
public java.lang.String grannyFormat(Datum datum,
Units units)
- Description copied from class:
DatumFormatter
- formats the Datum in the context of the units.
- Overrides:
grannyFormat
in class DatumFormatter
grannyFormat
public java.lang.String grannyFormat(Datum datum)
- Description copied from class:
DatumFormatter
- Returns the datum formatted as a String with special formatting
characters. As with format, this should be out-of-context and should
be tagged with the Units.
The default implementation just returns the result of
DatumFormatter.format(org.das2.datum.Datum)
- Overrides:
grannyFormat
in class DatumFormatter
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object