com.mmm.cms.util
Class IntegerFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by com.mmm.cms.util.IntegerFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class IntegerFormat
extends java.text.NumberFormat

This provides a concrete wrapper around the number format in order to allow output of decimal values. Besides limitting the decimal methods, it provides not additional functionality. Decimal values are not supported.

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
IntegerFormat()
          Constructor which sets the fill character to the default of 1 space, i.e.
IntegerFormat(char filler)
          Constructor that sets the filler to the supplied character
 
Method Summary
 java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
          Not supported for formatting double values
 java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
          Formats a long value to include the filler character if needed
 char getFillerChar()
          Get the value of fillerChar
 java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)
          Parses an integer based on the source string.
 void setCurrency(java.util.Currency currency)
          Not supported
 void setFillerChar(char fillerChar)
          Set the value of fillerChar
 void setMaximumFractionDigits(int newValue)
          Not supported
 void setMinimumFractionDigits(int newValue)
          Not supported
 
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, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setGroupingUsed, setMaximumIntegerDigits, setMinimumIntegerDigits, setParseIntegerOnly
 
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

IntegerFormat

public IntegerFormat()
Constructor which sets the fill character to the default of 1 space, i.e. ' '


IntegerFormat

public IntegerFormat(char filler)
Constructor that sets the filler to the supplied character

Parameters:
filler -
Method Detail

getFillerChar

public char getFillerChar()
Get the value of fillerChar

Returns:
the value of fillerChar

setFillerChar

public void setFillerChar(char fillerChar)
Set the value of fillerChar

Parameters:
fillerChar - new value of fillerChar

format

public java.lang.StringBuffer format(double number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)
Not supported for formatting double values

Specified by:
format in class java.text.NumberFormat
Parameters:
number -
toAppendTo -
pos -
Returns:

format

public java.lang.StringBuffer format(long number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)
Formats a long value to include the filler character if needed

Specified by:
format in class java.text.NumberFormat
Parameters:
number -
toAppendTo -
pos -
Returns:

parse

public java.lang.Number parse(java.lang.String source,
                              java.text.ParsePosition parsePosition)
Parses an integer based on the source string. Because it uses Integer.parseInt() it may throw a NumberFormatException when a bad number string is provided.

Specified by:
parse in class java.text.NumberFormat
Parameters:
source -
parsePosition -
Returns:
Throws:
java.lang.NumberFormatException

setCurrency

public void setCurrency(java.util.Currency currency)
Not supported

Overrides:
setCurrency in class java.text.NumberFormat
Parameters:
currency -

setMaximumFractionDigits

public void setMaximumFractionDigits(int newValue)
Not supported

Overrides:
setMaximumFractionDigits in class java.text.NumberFormat
Parameters:
newValue -

setMinimumFractionDigits

public void setMinimumFractionDigits(int newValue)
Not supported

Overrides:
setMinimumFractionDigits in class java.text.NumberFormat
Parameters:
newValue -