comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedPoint2ds.java @ 808:2e951160c43d

Finished the javadoc of the math package. gnv-artifacts/trunk@890 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 08 Apr 2010 16:35:02 +0000
parents c4156275c1e1
children f953c9a559d8
comparison
equal deleted inserted replaced
807:a645bd23c1c8 808:2e951160c43d
10 import java.util.HashMap; 10 import java.util.HashMap;
11 import java.util.List; 11 import java.util.List;
12 import java.util.Map; 12 import java.util.Map;
13 13
14 /** 14 /**
15 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> 15 * Stores the results of an area interpolation.
16 * Used to generate the final products.
17 *
18 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
16 */ 19 */
17 public class AttributedPoint2ds 20 public class AttributedPoint2ds
18 implements Serializable 21 implements Serializable
19 { 22 {
23 /**
24 * The list of input points.
25 */
20 protected List<? extends Point2d> points; 26 protected List<? extends Point2d> points;
27
28 /**
29 * The map of input attributes that are need to generate
30 * the products.
31 */
21 protected Map attributes; 32 protected Map attributes;
33
34 /**
35 * The interpolation result.
36 */
22 protected AreaInterpolation interpolation; 37 protected AreaInterpolation interpolation;
38
39 /**
40 * The JTS multi line strings to be written by GeoTools later.
41 */
23 protected List<Pair<Object, MultiLineString>> lineStrings; 42 protected List<Pair<Object, MultiLineString>> lineStrings;
43
44 /**
45 * The JTS multi polygons to be written by GeoTools later.
46 */
24 protected Map<Integer, MultiPolygon> polygons; 47 protected Map<Integer, MultiPolygon> polygons;
25 48
49 /**
50 * Default constructor.
51 */
26 public AttributedPoint2ds() { 52 public AttributedPoint2ds() {
27 } 53 }
28 54
55 /**
56 * Constructor to create a AttributedPoint2ds with a list
57 * of input points.
58 *
59 * @param points The input points.
60 */
29 public AttributedPoint2ds(List<? extends Point2d> points) { 61 public AttributedPoint2ds(List<? extends Point2d> points) {
30 this.points = points; 62 this.points = points;
31 } 63 }
32 64
65 /**
66 * Returns an attribute from the map of external attributes.
67 * @param key The key of the attribute.
68 * @return The attribute or null if the attribute was not found.
69 */
33 public Object getAttribute(Object key) { 70 public Object getAttribute(Object key) {
34 return attributes != null 71 return attributes != null
35 ? attributes.get(key) 72 ? attributes.get(key)
36 : null; 73 : null;
37 } 74 }
38 75
76 /**
77 * Stores an attribute under a given key in
78 * the map of external attributes.
79 * @param key The key of the attribute.
80 * @param value The attribute value.
81 */
39 public void setAttribute(Object key, Object value) { 82 public void setAttribute(Object key, Object value) {
40 if (attributes == null) { 83 if (attributes == null) {
41 attributes = new HashMap(); 84 attributes = new HashMap();
42 } 85 }
43 attributes.put(key, value); 86 attributes.put(key, value);
44 } 87 }
45 88
89 /**
90 * Returns the input points.
91 * @return The input points.
92 */
46 public List<? extends Point2d> getPoints() { 93 public List<? extends Point2d> getPoints() {
47 return points; 94 return points;
48 } 95 }
49 96
97 /**
98 * Sets the input points.
99 * @param points The input points.
100 */
50 public void setPoints(List<? extends Point2d> points) { 101 public void setPoints(List<? extends Point2d> points) {
51 this.points = points; 102 this.points = points;
52 } 103 }
53 104
105 /**
106 * Sets the area interpolation result.
107 * @param interpolation The new interpolation result.
108 */
54 public void setInterpolation(AreaInterpolation interpolation) { 109 public void setInterpolation(AreaInterpolation interpolation) {
55 this.interpolation = interpolation; 110 this.interpolation = interpolation;
56 } 111 }
57 112
113 /**
114 * Returns the area interpolation result.
115 * @return The interpolation result.
116 */
58 public AreaInterpolation getInterpolation() { 117 public AreaInterpolation getInterpolation() {
59 return interpolation; 118 return interpolation;
60 } 119 }
61 120
121 /**
122 * Sets the produced JTS multi polygons.
123 * @param polygons The multi polygons.
124 */
62 public void setPolygons(Map<Integer, MultiPolygon> polygons) { 125 public void setPolygons(Map<Integer, MultiPolygon> polygons) {
63 this.polygons = polygons; 126 this.polygons = polygons;
64 } 127 }
65 128
129 /**
130 * Returns the JTS multi polygons.
131 * @return The polygons.
132 */
66 public Map<Integer, MultiPolygon> getPolygons() { 133 public Map<Integer, MultiPolygon> getPolygons() {
67 return polygons; 134 return polygons;
68 } 135 }
69 136
137 /**
138 * Set the produced JTS multi line strings.
139 * @param lineStrings The line strings.
140 */
70 public void setLineStrings( 141 public void setLineStrings(
71 List<Pair<Object, MultiLineString>> lineStrings 142 List<Pair<Object, MultiLineString>> lineStrings
72 ) { 143 ) {
73 this.lineStrings = lineStrings; 144 this.lineStrings = lineStrings;
74 } 145 }
75 146
147 /**
148 * Returns the produced JTS multi line strings.
149 * @return The line strings.
150 */
76 public List<Pair<Object, MultiLineString>> getLineStrings() { 151 public List<Pair<Object, MultiLineString>> getLineStrings() {
77 return lineStrings; 152 return lineStrings;
78 } 153 }
79 } 154 }
80 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 155 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org