1 |
package skrueger; |
2 |
|
3 |
import java.util.HashSet; |
4 |
|
5 |
import org.opengis.feature.type.Name; |
6 |
|
7 |
import skrueger.geotools.Copyable; |
8 |
import skrueger.i8n.Translation; |
9 |
|
10 |
public interface AttributeMetadata extends Copyable<AttributeMetadata>, |
11 |
Comparable<AttributeMetadata> { |
12 |
|
13 |
/** |
14 |
* @return a translatable title for this attribute.. |
15 |
*/ |
16 |
public Translation getTitle(); |
17 |
|
18 |
/** |
19 |
* Set a translatable title for this attribute.. |
20 |
*/ |
21 |
public void setTitle(Translation title); |
22 |
|
23 |
/** |
24 |
* @return a translatable description for this attribute |
25 |
*/ |
26 |
public Translation getDesc(); |
27 |
|
28 |
/** |
29 |
* Set a translatable description for this attribute. |
30 |
*/ |
31 |
public void setDesc(Translation desc); |
32 |
|
33 |
/** |
34 |
* The local name. E.g. the name of the DBF column as a {@link String}. |
35 |
*/ |
36 |
public String getLocalName(); |
37 |
|
38 |
/** |
39 |
* A short form for #setName(new NameImpl(localName)) |
40 |
*/ |
41 |
public void setLocalName(String localName); |
42 |
|
43 |
/** |
44 |
* The fully qualified {@link Name} of the attribute, e.g. |
45 |
* <code>org.bla.plo:blub</code>. The second part equals the |
46 |
* {@link #getLocalName()} value. The first may be <code>null</code> or |
47 |
* represent the layer name. |
48 |
*/ |
49 |
public Name getName(); |
50 |
|
51 |
/** |
52 |
* set the fully qualified {@link Name} of this attribute. |
53 |
*/ |
54 |
public void setName(Name name); |
55 |
|
56 |
/** |
57 |
* A list og objects that represent NODATA-values for this attribute. The |
58 |
* objects are supporsed to be correctly casted already. That means that the |
59 |
* NODATA objects listed here have must have the same type as the values of |
60 |
* this object. |
61 |
*/ |
62 |
public HashSet<Object> getNodataValues(); |
63 |
|
64 |
/** |
65 |
* Takes any value object and checks it against the NODATA values. If the |
66 |
* value equals a NODATA value, <code>null</code> is returned. Otherwise the |
67 |
* same object is returned. |
68 |
* |
69 |
* Note: This method is called often. |
70 |
*/ |
71 |
public Object fiterNodata(Object value); |
72 |
|
73 |
/** |
74 |
* @return a non-translatable unit {@link String} for this attribute values. |
75 |
*/ |
76 |
public String getUnit(); |
77 |
|
78 |
/** |
79 |
* Set a unit {@link String} for this attribute values. |
80 |
*/ |
81 |
public void setUnit(String unit); |
82 |
|
83 |
/** |
84 |
* @return A value defining the position of this attribute whenever the |
85 |
* attributes are listed to an end-user. The higher the weight, the |
86 |
* lower the position. (heavy goes down, light goes up) |
87 |
*/ |
88 |
public double getWeight(); |
89 |
|
90 |
/** |
91 |
* set a value defining the position of this attribute whenever the |
92 |
* attributes are listed to an end-user. The higher the weight, the lower |
93 |
* the position. (heavy goes down, light goes up) |
94 |
*/ |
95 |
public void setWeight(double weight); |
96 |
|
97 |
/** |
98 |
* @return <code>false</code> if this attribute should not be selectable or |
99 |
* shown to the end-user. |
100 |
*/ |
101 |
public boolean isVisible(); |
102 |
|
103 |
/** |
104 |
* Set <code>false</code> if this attribute should not be shown to the |
105 |
* end-user. |
106 |
*/ |
107 |
public void setVisible(boolean visible); |
108 |
|
109 |
String getNoDataValuesFormatted(); |
110 |
|
111 |
} |