edu.sc.seis.fissuresUtil.display
Class ChoiceDecimalFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by edu.sc.seis.fissuresUtil.display.ChoiceDecimalFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ChoiceDecimalFormat
extends java.text.NumberFormat

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.NumberFormat
java.text.NumberFormat.Field
 
Field Summary
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
ChoiceDecimalFormat(double[] limits, java.text.DecimalFormat[] formats)
          for each double in limits, if a number is passed into format that is less than it the corresponding format from formats is used.
 
Method Summary
static ChoiceDecimalFormat createTomStyleA()
          This creates a ChoiceDecimalFormat where numbers < 100 have a single decimal, and numbers >=100 have none
static ChoiceDecimalFormat createTomStyleB()
          This creates a ChoiceDecimalFormat where numbers < 10 have a single decimal, and numbers >=10 have none
 java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
           
 java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
           
 java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)
           
 
Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, 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
 
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoiceDecimalFormat

public ChoiceDecimalFormat(double[] limits,
                           java.text.DecimalFormat[] formats)
for each double in limits, if a number is passed into format that is less than it the corresponding format from formats is used. if the number is greater than the last value in limits, the last format is used.

Method Detail

parse

public java.lang.Number parse(java.lang.String source,
                              java.text.ParsePosition parsePosition)
Specified by:
parse in class java.text.NumberFormat

format

public java.lang.StringBuffer format(double number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)
Specified by:
format in class java.text.NumberFormat

format

public java.lang.StringBuffer format(long number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)
Specified by:
format in class java.text.NumberFormat

createTomStyleA

public static ChoiceDecimalFormat createTomStyleA()
This creates a ChoiceDecimalFormat where numbers < 100 have a single decimal, and numbers >=100 have none


createTomStyleB

public static ChoiceDecimalFormat createTomStyleB()
This creates a ChoiceDecimalFormat where numbers < 10 have a single decimal, and numbers >=10 have none