KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > logicalcobwebs > proxool > FormatHelper


1 /*
2  * This software is released under a licence similar to the Apache Software Licence.
3  * See org.logicalcobwebs.proxool.package.html for details.
4  * The latest version is available at http://proxool.sourceforge.net
5  */

6 package org.logicalcobwebs.proxool;
7
8 import java.text.DecimalFormat JavaDoc;
9
10 /**
11  * Formats things as Strings
12  *
13  * @version $Revision: 1.1 $, $Date: 2003/03/05 18:42:33 $
14  * @author bill
15  * @author $Author: billhorsman $ (current maintainer)
16  * @since Proxool 0.8
17  */

18 public class FormatHelper {
19
20     private static DecimalFormat JavaDoc smallNumberFormat = new DecimalFormat JavaDoc("00");
21
22     private static DecimalFormat JavaDoc mediumNumberFormat = new DecimalFormat JavaDoc("0000");
23
24     private static DecimalFormat JavaDoc bigCountFormat = new DecimalFormat JavaDoc("###000000");
25
26     /**
27      * Format like 00
28      * @param value to format
29      * @return formatted value
30      */

31     public static String JavaDoc formatSmallNumber(long value) {
32         return smallNumberFormat.format(value);
33     }
34
35     /**
36      * Format like 0000
37      * @param value to format
38      * @return formatted value
39      */

40     public static String JavaDoc formatMediumNumber(long value) {
41         return mediumNumberFormat.format(value);
42     }
43
44     /**
45      * Format like ###000000
46      * @param value to format
47      * @return formatted value
48      */

49     public static String JavaDoc formatBigNumber(long value) {
50         return bigCountFormat.format(value);
51     }
52 }
53
54
55 /*
56  Revision history:
57  $Log: FormatHelper.java,v $
58  Revision 1.1 2003/03/05 18:42:33 billhorsman
59  big refactor of prototyping and house keeping to
60  drastically reduce the number of threads when using
61  many pools
62
63  */
Popular Tags