1 |
package skrueger.geotools; |
2 |
|
3 |
import java.util.List; |
4 |
|
5 |
import org.opengis.feature.type.Name; |
6 |
|
7 |
import skrueger.AttributeMetadataImpl; |
8 |
|
9 |
public class AttributeMetadataImplMap extends AttributeMetadataMap<AttributeMetadataImpl> { |
10 |
|
11 |
public AttributeMetadataImplMap(List<String> langs) { |
12 |
super(langs); |
13 |
} |
14 |
|
15 |
public AttributeMetadataImplMap() { |
16 |
super(); |
17 |
} |
18 |
|
19 |
/** |
20 |
* Returns a deep-copy. @see {@link Copyable} interface |
21 |
*/ |
22 |
@Override |
23 |
public AttributeMetadataImplMap copy() { |
24 |
final AttributeMetadataImplMap copy = new AttributeMetadataImplMap(langs); |
25 |
return (AttributeMetadataImplMap) copyTo(copy); |
26 |
} |
27 |
|
28 |
|
29 |
/** |
30 |
* Returns the {@link AttributeMetadataImpl} for a given {@link Name}. Never returns |
31 |
* <code>null</code>, but rather creates a default {@link AttributeMetadataImpl} on the |
32 |
* fly. |
33 |
*/ |
34 |
@Override |
35 |
public AttributeMetadataImpl get(final Name name) { |
36 |
final AttributeMetadataImpl AttributeMetadataImpl = super.get(name); |
37 |
if (AttributeMetadataImpl == null && name != null |
38 |
&& !name.getLocalPart().trim().isEmpty()) { |
39 |
|
40 |
put(name, new AttributeMetadataImpl(name, langs)); |
41 |
|
42 |
return super.get(name); |
43 |
} |
44 |
return AttributeMetadataImpl; |
45 |
} |
46 |
|
47 |
|
48 |
} |