ikayaki.gui
Class NullableDecimalFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by java.text.DecimalFormat
              extended by ikayaki.gui.NullableDecimalFormat
All Implemented Interfaces:
Serializable, Cloneable

public class NullableDecimalFormat
extends DecimalFormat

Decimal format that accepts an empty string. An empty string equals null.

If this class is used, it is not possible to use NumberFormatter's setMinimum and setMaximum values, because it will create a NullPointerException.

Author:
Esko Luontola
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field
 
Field Summary
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
NullableDecimalFormat()
           
 
Method Summary
 Object parseObject(String source)
           
 
Methods inherited from class java.text.DecimalFormat
applyLocalizedPattern, applyPattern, clone, equals, format, format, format, formatToCharacterIterator, getCurrency, getDecimalFormatSymbols, getGroupingSize, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getMultiplier, getNegativePrefix, getNegativeSuffix, getPositivePrefix, getPositiveSuffix, hashCode, isDecimalSeparatorAlwaysShown, isParseBigDecimal, parse, setCurrency, setDecimalFormatSymbols, setDecimalSeparatorAlwaysShown, setGroupingSize, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setMultiplier, setNegativePrefix, setNegativeSuffix, setParseBigDecimal, setPositivePrefix, setPositiveSuffix, toLocalizedPattern, toPattern
 
Methods inherited from class java.text.NumberFormat
format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setGroupingUsed, setParseIntegerOnly
 
Methods inherited from class java.text.Format
format
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullableDecimalFormat

public NullableDecimalFormat()
Method Detail

parseObject

public Object parseObject(String source)
                   throws ParseException
Overrides:
parseObject in class Format
Throws:
ParseException