Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java @ 815:22c18083225e
Removed compiler warnings while JavaDoc generation.
gnv-artifacts/trunk@900 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 12 Apr 2010 06:59:33 +0000 |
parents | 9d427dd2a96a |
children | 05bf8534a35a |
rev | line source |
---|---|
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
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 $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
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 $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 * created by: Stefan Blume (blume) |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 * erstellt am: 14.12.2007 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 * Copyright: con terra GmbH, 2005 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 * |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 * modified by: $Author: blume $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 * modified on: $Date: 2007/12/21 12:31:15 $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 * Version: $Revision: 1.2 $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 * TAG: $Name: $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 * locked from: $Locker: $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 * CVS State: $State: Exp $ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 * Project: $ProjectName$ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 */ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 package de.intevation.gnv.statistics; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 import org.apache.log4j.Logger; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 /** |
814
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
21 * This class stores a double value with a specific key. |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
93
diff
changeset
|
22 * |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 * @author blume |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 */ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 public class Statistic { |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 /** |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 * Default Logging instance |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 */ |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 private static Logger sLogger = Logger.getLogger(Statistic.class); |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 private static boolean sDebug = sLogger.isDebugEnabled(); |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 private double mValue; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 private String mKey; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 |
814
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
36 /** |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
37 * Creates a new Statistic with a given key and a value. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
38 * @param pKey The key. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
39 * @param pValue The value. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
40 */ |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 public Statistic(String pKey, double pValue) { |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 mKey = pKey; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 mValue = pValue; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 } |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 |
814
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
46 /** |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
47 * Returns the value. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
48 * @return the value. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
49 */ |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 public double getValue() { |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 return mValue; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 } |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 |
814
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
54 /** |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
55 * Returns the key. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
56 * @return the key. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
57 */ |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 public String getKey() { |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 return mKey; |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 } |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 |
814
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
62 /** |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
63 * Turns the value into string representation and returns it.<br> |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
64 * <b>Attention:</b> This method doesn't take a locale into account. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
65 * |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
66 * @return the value as string. |
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
67 */ |
93
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 public String getStringValue() { |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
69 java.text.DecimalFormat df = new java.text.DecimalFormat("#.##"); |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 return df.format(mValue); |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 } |
c476fbbaa4ca
Imported Statistics-Classes from old Project. Revision: 3101 Does not compile
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 } |
814
9d427dd2a96a
Added Javadoc in statistic package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
171
diff
changeset
|
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |