# HG changeset patch # User Ingo Weinzierl # Date 1269444727 0 # Node ID d70cac2bafc0e18fa50818b8ef98c7f147e7b7a8 # Parent 9ae63d39bdd012917ce1f5436be5b239806cdc6c Added and repaired javadoc in de.intevation.gnv.histogram package. gnv-artifacts/trunk@826 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9ae63d39bdd0 -r d70cac2bafc0 gnv-artifacts/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/gnv/layer/LayerArtifact.java: Removed empty diff -r 9ae63d39bdd0 -r d70cac2bafc0 gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java --- 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 Ingo Weinzierl */ 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 values = new ArrayList(); - - 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 id 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();