Layer.java 2.18 KB
Newer Older
1
package eu.simstadt.nf4j;
2
3
4
5
6
7
8
9

/**
 * A layer describes an aspect of a nF product and the type of its data. For instance, a layer could contain
 * all house numbers of all buildings of the product.
 *   
 * @author Marcel Bruse
 */
public class Layer {
10
11
12
13
14
15
	
	private static final String DEFAULT_NAME = "GML";
	
	private static final String DEFAULT_PRODUCT = "WU3";
	
	private static final String DEFAULT_STYLE = "#000000";
16
17
18
19
20
21
22
23
24
25

	/** The name of the layer. */
	private String name;
	
	/** The name of the product to which this layer belongs. */
	private String product;
	
	/** The style of this layer. Should be a color code (?). */
	private String style;
	
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
	/**
	 * The standard constructor.
	 */
	public Layer() {}
	
	/**
	 * A convenience constructor for layers.
	 * 
	 * @param name The name of the layer. This layer has to exist within the product.
	 * @param product The name of the product. This product has to exist in the database.
	 * @param style The purpose of this field is unknown.
	 */
	public Layer(String name, String product, String style) {
		this.name = name;
		this.product = product;
		this.style = style;
	}
	
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
	/**
	 * @return Returns the name of the layer.
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Sets the name of the layer.
	 * 
	 * @param name The name of the layer.
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * @return Returns the name of the layer's product.
	 */
	public String getProduct() {
		return product;
	}
	
	/**
	 * Sets the product of this layer.
	 *  
	 * @param product The product of this layer.
	 */
	public void setProduct(String product) {
		this.product = product;
	}
	
	/**
	 * @return Returns the style of the layer.
	 */
	public String getStyle() {
		return style;
	}
	
	/**
	 * Sets the style of this layer. Should be a color code (?).
	 * 
	 * @param style The style of this layer.
	 */
	public void setStyle(String style) {
		this.style = style;
	}
	
92
93
94
95
96
97
98
99
	public static Layer getDefaultLayer() {
		Layer layer = new Layer();
		layer.setName(DEFAULT_NAME);
		layer.setProduct(DEFAULT_PRODUCT);
		layer.setStyle(DEFAULT_STYLE);
		return layer;
	}
	
100
}