Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java @ 875:5e9efdda6894
merged gnv-artifacts/1.0
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:56 +0200 |
parents | dfd02f8d3602 |
children | f953c9a559d8 |
comparison
equal
deleted
inserted
replaced
722:bb3ffe7d719e | 875:5e9efdda6894 |
---|---|
1 /** | |
2 * Title: Statistic, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/Statistic.java,v 1.2 2007/12/21 12:31:15 blume Exp $ | |
3 * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/Statistic.java,v $ | |
4 * created by: Stefan Blume (blume) | |
5 * erstellt am: 14.12.2007 | |
6 * Copyright: con terra GmbH, 2005 | |
7 * | |
8 * modified by: $Author: blume $ | |
9 * modified on: $Date: 2007/12/21 12:31:15 $ | |
10 * Version: $Revision: 1.2 $ | |
11 * TAG: $Name: $ | |
12 * locked from: $Locker: $ | |
13 * CVS State: $State: Exp $ | |
14 * Project: $ProjectName$ | |
15 */ | |
16 package de.intevation.gnv.statistics; | |
17 | |
18 import org.apache.log4j.Logger; | |
19 | |
20 /** | |
21 * This class stores a double value with a specific key. | |
22 * | |
23 * @author blume | |
24 */ | |
25 public class Statistic { | |
26 | |
27 /** | |
28 * Default Logging instance | |
29 */ | |
30 private static Logger sLogger = Logger.getLogger(Statistic.class); | |
31 private static boolean sDebug = sLogger.isDebugEnabled(); | |
32 | |
33 private double mValue; | |
34 private String mKey; | |
35 | |
36 /** | |
37 * Creates a new Statistic with a given key and a value. | |
38 * @param pKey The key. | |
39 * @param pValue The value. | |
40 */ | |
41 public Statistic(String pKey, double pValue) { | |
42 mKey = pKey; | |
43 mValue = pValue; | |
44 } | |
45 | |
46 /** | |
47 * Returns the value. | |
48 * @return the value. | |
49 */ | |
50 public double getValue() { | |
51 return mValue; | |
52 } | |
53 | |
54 /** | |
55 * Returns the key. | |
56 * @return the key. | |
57 */ | |
58 public String getKey() { | |
59 return mKey; | |
60 } | |
61 | |
62 /** | |
63 * Turns the value into string representation and returns it.<br> | |
64 * <b>Attention:</b> This method doesn't take a locale into account. | |
65 * | |
66 * @return the value as string. | |
67 */ | |
68 public String getStringValue() { | |
69 java.text.DecimalFormat df = new java.text.DecimalFormat("#.##"); | |
70 return df.format(mValue); | |
71 } | |
72 } | |
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |