Mercurial > dive4elements > gnv-client
changeset 770:d70cac2bafc0
Added and repaired javadoc in de.intevation.gnv.histogram package.
gnv-artifacts/trunk@826 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Mar 2010 15:32:07 +0000 |
parents | 9ae63d39bdd0 |
children | a0e63136954e |
files | gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java |
diffstat | 2 files changed, 51 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog Wed Mar 24 15:14:54 2010 +0000 +++ b/gnv-artifacts/ChangeLog Wed Mar 24 15:32:07 2010 +0000 @@ -1,3 +1,9 @@ +2010-03-24 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/histogram/HistogramHelper.java: Removed a + method which was commented out, added javadocs and turned javadoc author + tag into a 'mailto' form. + 2010-03-24 Ingo Weinzierl <ingo.weinzierl@intevation.de> * src/main/java/de/intevation/gnv/layer/LayerArtifact.java: Removed empty
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java Wed Mar 24 15:14:54 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java Wed Mar 24 15:32:07 2010 +0000 @@ -14,55 +14,39 @@ /** - * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + * This class supports some helper methods for histogram charts. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class HistogramHelper { + /** + * Logger used for logging with log4j. + */ private static Logger logger = Logger.getLogger(HistogramHelper.class); + /** + * Disabled HistogramHelper constructor. This is a helper class and no + * instance should be instantiated from this class. + */ private HistogramHelper() { } -/* - public static Object[][] prepareHistogramData( - Collection input, - Collection parameters, - Collection measurements, - Collection dates - ) { - List<Double> values = new ArrayList<Double>(); - - ResultDescriptor rd; - int b1Idx, b2Idx, b3Idx, yIdx; - - Iterator it = parameters.iterator(); - KeyValueDescibeData param = (KeyValueDescibeData) it.hasNext(); - int parameter = param.getValue(); - - Iterator iter = input.iterator(); - while (iter.hasNext()) { - Result row = (Result) iter.next(); - - if (rd == null) { - rd = row.getResultDescriptor(); - b1Idx = rd.getColumnIndex("GROUP1"); - b2Idx = rd.getColumnIndex("GROUP2"); - b3Idx = rd.getColumnIndex("GROUP3"); - } - - if (row.getInteger(b1Idx) == parameter - && row.getInteger(b2Idx) == measurement) - { - - } - } - - return null; - } - */ - + /** + * This function prepare some input data and turns it into an array which is + * taken by {@link de.intevation.gnv.chart.DefaultHistogram}. + * + * @param input A collection with the data used to be displayed in a + * histogram + * @param parameters A collection with a bunch of parameters + * @param measurements A collection with a bunch of measurements + * @param dates A collection with a bunch of dates + * + * @return Object[][] containing raw data which can be used to create + * histograms + */ public static Object[][] prepareHistogramData( Collection input, Collection parameters, @@ -187,6 +171,19 @@ } + /** + * This method generates a string made up of parameter name and a + * measurement. + * + * @param break1 Id of a parameter. + * @param break2 Id of a measurement. + * @param break3 Id of a date. + * @param parameters A collection with a bunch of parameters. + * @param measurements A collection with a bunch of measurements. + * @param dates A collection with a bunch of dates. + * + * @return Concatenated string (${parametername} + ${measurement} + m). + */ protected static String generateName( String break1, String break2, String break3, Collection parameters, Collection measurements, Collection dates) @@ -196,6 +193,15 @@ } + /** + * Find a value with the given <code>id</code> and return its description. + * + * @param values A collection which contains the value we are searching for + * @param id Id of the value + * + * @return String representation of the value. An empty string is returned + * if no value have been found with the given id. + */ protected static String findValueTitle(Collection values, String id) { if (values != null) { Iterator it = values.iterator();