Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedXYColumns.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 | 2e951160c43d |
children | f953c9a559d8 |
comparison
equal
deleted
inserted
replaced
722:bb3ffe7d719e | 875:5e9efdda6894 |
---|---|
1 package de.intevation.gnv.math; | |
2 | |
3 import de.intevation.gnv.jfreechart.PolygonDataset; | |
4 | |
5 import java.io.Serializable; | |
6 | |
7 import java.util.HashMap; | |
8 import java.util.List; | |
9 import java.util.Map; | |
10 | |
11 /** | |
12 * Stores the results of a 3D interpolation. Used to generate the final | |
13 * products. | |
14 * | |
15 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
16 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | |
17 */ | |
18 public class AttributedXYColumns | |
19 implements Serializable | |
20 { | |
21 /** | |
22 * The list of height value column. | |
23 */ | |
24 protected List<? extends XYColumn> columns; | |
25 | |
26 /** | |
27 * The extra input attributes which are not relevant | |
28 * for the interpolation but for generating the results. | |
29 */ | |
30 protected Map attributes; | |
31 | |
32 /** | |
33 * The interpolation result. | |
34 */ | |
35 protected Interpolation3D interpolation; | |
36 | |
37 /** | |
38 * Dataset to be used in a {@link de.intevation.gnv.jfreechart.PolygonPlot}. | |
39 */ | |
40 protected PolygonDataset dataset; | |
41 | |
42 /** | |
43 * Default constructor. | |
44 */ | |
45 public AttributedXYColumns() { | |
46 } | |
47 | |
48 /** | |
49 * Constructor to create a AttributedXYColumns instance only | |
50 * with the height value columns. | |
51 * @param columns The height value columns. | |
52 */ | |
53 public AttributedXYColumns(List<? extends XYColumn> columns) { | |
54 this(columns, null); | |
55 } | |
56 | |
57 /** | |
58 * Constructor to create a AttributedXYColumns with | |
59 * height value columns and the attributes to be used to | |
60 * generate the results. | |
61 * @param columns The height value columns. | |
62 * @param attributes The external attributes. | |
63 */ | |
64 public AttributedXYColumns( | |
65 List<? extends XYColumn> columns, | |
66 Map attributes | |
67 ) { | |
68 this.columns = columns; | |
69 this.attributes = attributes; | |
70 } | |
71 | |
72 /** | |
73 * Gets an attribute. | |
74 * @param key The key of the attribute. | |
75 * @return The attribute or null if no such attribue is found. | |
76 */ | |
77 public Object getAttribute(Object key) { | |
78 return attributes != null | |
79 ? attributes.get(key) | |
80 : null; | |
81 } | |
82 | |
83 /** | |
84 * Puts an attribute to the map of external attributes. | |
85 * @param key The key of the attribute. | |
86 * @param value The value of the attribute. | |
87 */ | |
88 public void setAttribute(Object key, Object value) { | |
89 if (attributes == null) { | |
90 attributes = new HashMap(); | |
91 } | |
92 attributes.put(key, value); | |
93 } | |
94 | |
95 /** | |
96 * Returns the list of height value columns. | |
97 * @return The list of height value columns. | |
98 */ | |
99 public List<? extends XYColumn> getXYColumns() { | |
100 return columns; | |
101 } | |
102 | |
103 /** | |
104 * Sets the list of height value columns. | |
105 * @param columns The new list of height value columns. | |
106 */ | |
107 public void setXYColumns(List<? extends XYColumn> columns) { | |
108 this.columns = columns; | |
109 } | |
110 | |
111 /** | |
112 * Sets the interpolation result. | |
113 * @param interpolation The new interpolation result. | |
114 */ | |
115 public void setInterpolation(Interpolation3D interpolation) { | |
116 this.interpolation = interpolation; | |
117 } | |
118 | |
119 /** | |
120 * Gets the interpolation results. | |
121 * @return The interpolation results. | |
122 */ | |
123 public Interpolation3D getInterpolation() { | |
124 return interpolation; | |
125 } | |
126 | |
127 /** | |
128 * Sets the generated polygon data set to be used in a | |
129 * {@link de.intevation.gnv.jfreechart.PolygonPlot}. | |
130 * @param dataset The polygon data set. | |
131 */ | |
132 public void setPolygonDataset(PolygonDataset dataset) { | |
133 this.dataset = dataset; | |
134 } | |
135 | |
136 /** | |
137 * Returns the polygon data set. | |
138 * @return The polygon data set. | |
139 */ | |
140 public PolygonDataset getPolygonDataset() { | |
141 return dataset; | |
142 } | |
143 } | |
144 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |