1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.internal.macro.chart.source.table

File TableDatasetBuilder.java

 

Code metrics

0
0
0
1
120
19
0
-
-
0
-

Classes

Class Line # Actions
TableDatasetBuilder 38 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.rendering.internal.macro.chart.source.table;
21   
22    import java.util.Map;
23   
24    import org.jfree.data.general.Dataset;
25    import org.xwiki.rendering.internal.macro.chart.source.LocaleConfiguration;
26    import org.xwiki.rendering.macro.MacroExecutionException;
27   
28    /**
29    * The jfree chart library generates charts from different classes of datasets. This is a common interface for classes
30    * that implements building datasets from table data sources.
31    *
32    * Please, note the distinction between a data source and a dataset. A data source is something from which data is
33    * extracted, while a dataset is an encapsulation of data that can be passed to the chart library.
34    *
35    * @version $Id: fe70092751c597b46e04579638bc13ed3ef6e4fb $
36    * @since 4.2M1
37    */
 
38    public interface TableDatasetBuilder
39    {
40    /**
41    * Set the number of rows in the table.
42    *
43    * @param numberOfRows the number of rows.
44    */
45    void setNumberOfRows(int numberOfRows);
46   
47    /**
48    * Set the number of columns in the table.
49    *
50    * @param numberOfColumns the number of columns.
51    */
52    void setNumberOfColumns(int numberOfColumns);
53   
54    /**
55    * Set the column heading at the given column index.
56    *
57    * @param columnIndex The column index.
58    * @param heading The heading text.
59    * @throws MacroExecutionException if the heading is invalid for the dataset.
60    */
61    void setColumnHeading(int columnIndex, String heading) throws MacroExecutionException;
62   
63    /**
64    * Set the row heading at the given column index.
65    *
66    * @param rowIndex The row index.
67    * @param heading The heading text.
68    * @throws MacroExecutionException if the heading is invalid for the dataset.
69    */
70    void setRowHeading(int rowIndex, String heading) throws MacroExecutionException;
71   
72    /**
73    * Set a value in the dataset.
74    *
75    * @param rowIndex The row index.
76    * @param columnIndex The column index.
77    * @param value The value.
78    * @throws MacroExecutionException if the value is invalid for the dataset.
79    */
80    void setValue(int rowIndex, int columnIndex, Number value) throws MacroExecutionException;
81   
82    /**
83    * Set wether the table should be transposed.
84    *
85    * @param transpose Indicates that the table shoudl be transposed.
86    */
87    void setTranspose(boolean transpose);
88   
89    /**
90    * @return the built dataset.
91    */
92    Dataset getDataset();
93   
94    /**
95    * Configure the dataset builder from the parameters.
96    *
97    * @param parameters The parameters.
98    * @throws MacroExecutionException if the parameters are invalid for this builder.
99    */
100    void setParameters(Map<String, String> parameters) throws MacroExecutionException;
101   
102    /**
103    * @return indication of whether column headings should be forced. I.e., if the first column must be headings even
104    * if included in the range.
105    */
106    boolean forceColumnHeadings();
107   
108    /**
109    * @return indication of whether row headings should be forced. I.e., if the first row must be headings even
110    * if included in the range.
111    */
112    boolean forceRowHeadings();
113   
114    /**
115    * Set the locale configuration for the builders that needs it.
116    *
117    * @param localeConfiguration The locale configuration
118    */
119    void setLocaleConfiguration(LocaleConfiguration localeConfiguration);
120    }