/[schmitzm]/trunk/src/skrueger/geotools/AttributeMetadataImplMap.java
ViewVC logotype

Annotation of /trunk/src/skrueger/geotools/AttributeMetadataImplMap.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 770 - (hide annotations)
Sun Mar 21 11:36:11 2010 UTC (14 years, 11 months ago) by alfonx
File MIME type: text/plain
File size: 1277 byte(s)
Had to switch the AttributeMetadata key from org.opengis.feature.type.Name to geotools.NameImpl. That sounds not-so-nice, because it is generally better to program against an interface instead of an implementation, BUT NameImpl implements Serializable which is a big help when i want to map that AttributeMetaDataMap in another project.
1 alfonx 769 package skrueger.geotools;
2    
3     import java.util.List;
4    
5 alfonx 770 import org.geotools.feature.NameImpl;
6 alfonx 769 import org.opengis.feature.type.Name;
7    
8     import skrueger.AttributeMetadataImpl;
9    
10     public class AttributeMetadataImplMap extends AttributeMetadataMap<AttributeMetadataImpl> {
11    
12 alfonx 770 private static final long serialVersionUID = 6781939984242527498L;
13    
14    
15 alfonx 769 public AttributeMetadataImplMap(List<String> langs) {
16     super(langs);
17     }
18    
19     public AttributeMetadataImplMap() {
20     super();
21     }
22    
23     /**
24     * Returns a deep-copy. @see {@link Copyable} interface
25     */
26     @Override
27     public AttributeMetadataImplMap copy() {
28     final AttributeMetadataImplMap copy = new AttributeMetadataImplMap(langs);
29     return (AttributeMetadataImplMap) copyTo(copy);
30     }
31    
32    
33     /**
34     * Returns the {@link AttributeMetadataImpl} for a given {@link Name}. Never returns
35     * <code>null</code>, but rather creates a default {@link AttributeMetadataImpl} on the
36     * fly.
37     */
38     @Override
39 alfonx 770 public AttributeMetadataImpl get(final NameImpl name) {
40 alfonx 769 final AttributeMetadataImpl AttributeMetadataImpl = super.get(name);
41     if (AttributeMetadataImpl == null && name != null
42     && !name.getLocalPart().trim().isEmpty()) {
43    
44     put(name, new AttributeMetadataImpl(name, langs));
45    
46     return super.get(name);
47     }
48     return AttributeMetadataImpl;
49     }
50    
51    
52     }

Properties

Name Value
svn:eol-style native
svn:keywords Id URL
svn:mime-type text/plain

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26