DESY ACOP Beans Home

com.cosylab.util
Class FormatCache

java.lang.Object
  extended by com.cosylab.util.FormatCache

public final class FormatCache
extends java.lang.Object

Helper class that caches PrintfFormat classes. Used by table renderers, which need to switch between small number of different formats.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
FormatCache()
           
 
Method Summary
static PrintfFormat getDefaultFormatter()
          Returns default formatter with format string %4.4f.
static PrintfFormat getFormatter(java.lang.String format)
          Returns instance of PrintfFormat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatCache

public FormatCache()
Method Detail

getFormatter

public static PrintfFormat getFormatter(java.lang.String format)
Returns instance of PrintfFormat. If formatter does not already exist in cache, new instance will be created. If format is invalid, null will be returned.

Parameters:
format - C-Style format string.
Returns:
Instance of formatter or null if format string is invalid.

getDefaultFormatter

public static PrintfFormat getDefaultFormatter()
Returns default formatter with format string %4.4f. This method will always return valid formatter.

Returns:
Instance of formatter with default format string %4.4f.


Copyright © 2010. All Rights Reserved.