Class EmptyNumberFormat

java.lang.Object
java.text.Format
java.text.NumberFormat
com.jgoodies.common.format.EmptyNumberFormat
All Implemented Interfaces:
Serializable, Cloneable

public final class EmptyNumberFormat extends NumberFormat
Wraps a given NumberFormat and adds behavior to convert to/from the empty string. Therefore it holds an empty value that is mapped to/from the empty string. The #format result of the empty value is the empty string, and the #parse result of the empty string is the empty value. In all other cases the formatting and parsing is forwarded to the wrapped NumberFormat.

Examples:

 new EmptyNumberFormat(NumberFormat().getInstance());
 new EmptyNumberFormat(NumberFormat().getIntegerInstance(), -1);
 
See Also: