Class ScientificNumberFormatter
java.lang.Object
java.text.Format
java.text.NumberFormat
com.illumon.iris.db.plot.axisformatters.ScientificNumberFormatter
- All Implemented Interfaces:
Serializable
,Cloneable
public class ScientificNumberFormatter extends NumberFormat
NumberFormat
which formats numbers in scientific notation
if they are outside the given range.- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field, NumberFormat.Style
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ScientificNumberFormatter()
Creates a ScientificNumberFormatter instance with the default number of decimals, lower limit, and upper limit.ScientificNumberFormatter(int numDecimals, double lowerLimit, double upperLimit)
Creates a ScientificNumberFormatter instance. -
Method Summary
Modifier and Type Method Description StringBuffer
format(double number, StringBuffer toAppendTo, FieldPosition pos)
StringBuffer
format(long number, StringBuffer toAppendTo, FieldPosition pos)
Number
parse(String source, ParsePosition parsePosition)
Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
-
Constructor Details
-
ScientificNumberFormatter
public ScientificNumberFormatter()Creates a ScientificNumberFormatter instance with the default number of decimals, lower limit, and upper limit. -
ScientificNumberFormatter
public ScientificNumberFormatter(int numDecimals, double lowerLimit, double upperLimit)Creates a ScientificNumberFormatter instance.- Parameters:
numDecimals
- the max number of decimals to displaylowerLimit
- gives a range around 0 [-lowerLimit, lowerLimit] for which each number inside the range excluding 0 will be formatted with scientific notationupperLimit
- gives a range around 0 [-upperLimit, upperLimit] for which each number outside the range will be formatted with scientific notation
-
-
Method Details
-
format
- Specified by:
format
in classNumberFormat
-
format
- Specified by:
format
in classNumberFormat
-
parse
- Specified by:
parse
in classNumberFormat
-