biweekly.util
Class ICalFloatFormatter

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by java.text.DecimalFormat
              extended by biweekly.util.ICalFloatFormatter
All Implemented Interfaces:
Serializable, Cloneable

public class ICalFloatFormatter
extends DecimalFormat

Formats floating-point values for iCalendar objects. Notably, this ensures that a "." is used as decimal separater, no matter the locale.

Author:
Michael Angstadt
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
ICalFloatFormatter()
          Creates a new formatter with a max of 6 decimals.
ICalFloatFormatter(int decimals)
          Creates a new formatter.
 
Method Summary
 
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, getRoundingMode, hashCode, isDecimalSeparatorAlwaysShown, isParseBigDecimal, parse, setCurrency, setDecimalFormatSymbols, setDecimalSeparatorAlwaysShown, setGroupingSize, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setMultiplier, setNegativePrefix, setNegativeSuffix, setParseBigDecimal, setPositivePrefix, setPositiveSuffix, setRoundingMode, 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, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICalFloatFormatter

public ICalFloatFormatter()
Creates a new formatter with a max of 6 decimals.


ICalFloatFormatter

public ICalFloatFormatter(int decimals)
Creates a new formatter.

Parameters:
decimals - the max number of decimal places


Copyright © 2013 Michael Angstadt. All Rights Reserved.