fop 1.0

org.apache.fop.util
Class DecimalFormatCache

java.lang.Object
  extended by org.apache.fop.util.DecimalFormatCache

public class DecimalFormatCache
extends java.lang.Object

This class provides a cache for DecimalFormat instance. DecimalFormat itself is not thread-safe but since FOP needs to format a lot of numbers the same way, it shall be cached in a ThreadLocal.


Constructor Summary
DecimalFormatCache()
           
 
Method Summary
static java.text.DecimalFormat getDecimalFormat(int dec)
          Returns a cached DecimalFormat instance for the given number of decimal digits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalFormatCache

public DecimalFormatCache()
Method Detail

getDecimalFormat

public static java.text.DecimalFormat getDecimalFormat(int dec)
Returns a cached DecimalFormat instance for the given number of decimal digits.

Parameters:
dec - the number of decimal digits.
Returns:
the DecimalFormat instance

fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.