codeblockutil
Class NumberFormatter

java.lang.Object
  extended by codeblockutil.NumberFormatter

public class NumberFormatter
extends java.lang.Object

Class for displaying a number based on a specified level of precision and other display parameters.


Nested Class Summary
static interface NumberFormatter.PrecisionSpecifier
          Specifies the "amount of precision" to use.
 
Field Summary
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier HIGH_PRECISION
           
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier LOW_PRECISION
           
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier MEDIUM_PRECISION
           
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier VERY_LOW_PRECISION
           
 
Constructor Summary
NumberFormatter()
           
NumberFormatter(NumberFormatter.PrecisionSpecifier ps)
           
NumberFormatter(NumberFormatter.PrecisionSpecifier ps, char eCharacter, boolean showZeroBeforeDecimal, boolean showPlusInExponent, boolean showExtraZeros)
           
NumberFormatter(NumberFormatter.PrecisionSpecifier ps, java.lang.String eCharacter, boolean showZeroBeforeDecimal, boolean showPlusInExponent, boolean showExtraZeros)
           
 
Method Summary
 java.lang.String format(double x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOW_PRECISION

public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier LOW_PRECISION

MEDIUM_PRECISION

public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier MEDIUM_PRECISION

HIGH_PRECISION

public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier HIGH_PRECISION

VERY_LOW_PRECISION

public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier VERY_LOW_PRECISION
Constructor Detail

NumberFormatter

public NumberFormatter()

NumberFormatter

public NumberFormatter(NumberFormatter.PrecisionSpecifier ps)

NumberFormatter

public NumberFormatter(NumberFormatter.PrecisionSpecifier ps,
                       char eCharacter,
                       boolean showZeroBeforeDecimal,
                       boolean showPlusInExponent,
                       boolean showExtraZeros)
Parameters:
showPlusInExponent - Whether to show the '+' character when displaying a number with e notation (e.g. 1.5e+12)

NumberFormatter

public NumberFormatter(NumberFormatter.PrecisionSpecifier ps,
                       java.lang.String eCharacter,
                       boolean showZeroBeforeDecimal,
                       boolean showPlusInExponent,
                       boolean showExtraZeros)
Parameters:
showPlusInExponent - Whether to show the '+' character when displaying a number with e notation (e.g. 1.5e+12)
Method Detail

format

public java.lang.String format(double x)