org.tbee.swing.text
Class NumberFormatCaster
java.lang.Object
java.text.Format
org.tbee.swing.text.NumberFormatCaster
- All Implemented Interfaces:
- Serializable, Cloneable
public class NumberFormatCaster
- extends Format
Converts a value returned by NumberFormat to a certain class (e.g. Integer)
This is convenient when using binding.
- Author:
- user
- See Also:
- Serialized Form
NumberFormatCaster
public NumberFormatCaster(NumberFormat numberFormat,
Class type)
- Parameters:
numberFormat - type -
NumberFormatCaster
public NumberFormatCaster(NumberFormat numberFormat,
int minFractionDigits)
- Parameters:
numberFormat - type - minFractionDigits - this makes only sense for BigDecimals where 0.0 is not equal to 0.000
NumberFormatCaster
public NumberFormatCaster(NumberFormat numberFormat,
Class type,
int minFractionDigits)
- Parameters:
numberFormat - type - minFractionDigits - this makes only sense for BigDecimals where 0.0 is not equal to 0.000
getNumberFormat
public NumberFormat getNumberFormat()
getType
public Class getType()
getMinFractionDigits
public int getMinFractionDigits()
format
public StringBuffer format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
- Specified by:
format in class Format
parseObject
public Object parseObject(String source,
ParsePosition pos)
- Specified by:
parseObject in class Format
Copyright © 2012 KnowledgePlaza. All Rights Reserved.