comparison gnv-artifacts/src/main/java/de/intevation/gnv/raster/ExternalIndexConverter.java @ 802:4abe172be970

Finished Javadoc of the raster package. gnv-artifacts/trunk@884 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 07 Apr 2010 07:49:12 +0000
parents c4156275c1e1
children feae2f9d6c6f
comparison
equal deleted inserted replaced
801:d766fe2d917a 802:4abe172be970
1 package de.intevation.gnv.raster; 1 package de.intevation.gnv.raster;
2 2
3 import org.apache.log4j.Logger; 3 import org.apache.log4j.Logger;
4 4
5 /** 5 /**
6 * Converts the interal color index of a polygon to the external index
7 * defined by the corresponding palette entry.
8 *
6 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> 9 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
7 */ 10 */
8 public class ExternalIndexConverter 11 public class ExternalIndexConverter
9 implements JTSMultiPolygonProducer.ValueConverter 12 implements JTSMultiPolygonProducer.ValueConverter
10 { 13 {
11 private static Logger log = Logger.getLogger( 14 private static Logger log = Logger.getLogger(
12 ExternalIndexConverter.class); 15 ExternalIndexConverter.class);
13 16
17 /**
18 * The palette where to find the color indices.
19 */
14 protected Palette palette; 20 protected Palette palette;
15 21
22 /**
23 * Default constructor.
24 */
16 public ExternalIndexConverter() { 25 public ExternalIndexConverter() {
17 } 26 }
18 27
28 /**
29 * Constrcutor to create an ExternalIndexConverter with
30 * a given palette.
31 * @param palette The palette where to find the color indices.
32 */
19 public ExternalIndexConverter(Palette palette) { 33 public ExternalIndexConverter(Palette palette) {
20 this.palette = palette; 34 this.palette = palette;
21 } 35 }
22 36
37 /**
38 * Maps the color index of a polygon to the external index
39 * defined by the corresponing palette entry.
40 * @param value The value to convert
41 * @return The mapped value or the original value if
42 * no corresponing palette entry was found.
43 */
23 public Integer convert(Integer value) { 44 public Integer convert(Integer value) {
24 if (value == null) { 45 if (value == null) {
25 return value; 46 return value;
26 } 47 }
27 48

http://dive4elements.wald.intevation.org