/[schmitzm]/trunk/src/skrueger/AttributeMetadataImpl.java
ViewVC logotype

Diff of /trunk/src/skrueger/AttributeMetadataImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 769 by alfonx, Sun Mar 21 11:02:34 2010 UTC revision 772 by alfonx, Sun Mar 21 14:05:26 2010 UTC
# Line 35  import java.util.List; Line 35  import java.util.List;
35  import org.apache.log4j.Logger;  import org.apache.log4j.Logger;
36  import org.geotools.feature.NameImpl;  import org.geotools.feature.NameImpl;
37  import org.opengis.feature.type.AttributeDescriptor;  import org.opengis.feature.type.AttributeDescriptor;
 import org.opengis.feature.type.Name;  
38    
39  import skrueger.geotools.Copyable;  import skrueger.geotools.Copyable;
40  import skrueger.geotools.StyledLayerInterface;  import skrueger.geotools.StyledLayerInterface;
# Line 72  public class AttributeMetadataImpl exten Line 71  public class AttributeMetadataImpl exten
71    
72          public AttributeMetadataImpl(final AttributeDescriptor attDesc,          public AttributeMetadataImpl(final AttributeDescriptor attDesc,
73                          final int weight, final List<String> langs) {                          final int weight, final List<String> langs) {
74                  this(attDesc.getName(), langs);                  this( new NameImpl(attDesc.getName().getNamespaceURI(), attDesc.getName().getLocalPart()), langs);
75                  setWeight(weight);                  setWeight(weight);
76          }          }
77    
78          public AttributeMetadataImpl(final AttributeDescriptor attDesc,          public AttributeMetadataImpl(final AttributeDescriptor attDesc,
79                          final List<String> langs) {                          final List<String> langs) {
80                  this(attDesc.getName(), langs);                  this(new NameImpl(attDesc.getName().getNamespaceURI(), attDesc.getName().getLocalPart()), langs);
81          }          }
82    
83          /**          /**
# Line 97  public class AttributeMetadataImpl exten Line 96  public class AttributeMetadataImpl exten
96           * @param unit           * @param unit
97           *            {@link String} of the unit that the information is in           *            {@link String} of the unit that the information is in
98           */           */
99          public AttributeMetadataImpl(final Name name, final Boolean visible,          public AttributeMetadataImpl(final NameImpl name, final Boolean visible,
100                          final Translation title, final Translation desc, final String unit) {                          final Translation title, final Translation desc, final String unit) {
101    
102                  this.setName(name);                  this.setName(name);
# Line 119  public class AttributeMetadataImpl exten Line 118  public class AttributeMetadataImpl exten
118           * @param unit           * @param unit
119           *            {@link String} of the unit that the information is in           *            {@link String} of the unit that the information is in
120           */           */
121          public AttributeMetadataImpl(final Name name, final Boolean visible,          public AttributeMetadataImpl(final NameImpl name, final Boolean visible,
122                          final String unit) {                          final String unit) {
123                  this.setName(name);                  this.setName(name);
124                  this.visible = visible;                  this.visible = visible;
# Line 129  public class AttributeMetadataImpl exten Line 128  public class AttributeMetadataImpl exten
128          /**          /**
129           * Creates a new visible {@link AttributeMetadataImpl}           * Creates a new visible {@link AttributeMetadataImpl}
130           */           */
131          public AttributeMetadataImpl(final Name name, final List<String> langs) {          public AttributeMetadataImpl(final NameImpl name, final List<String> langs) {
132                  this(name, true, new Translation(langs, name.getLocalPart()),                  this(name, true, new Translation(langs, name.getLocalPart()),
133                                  new Translation(), "");                                  new Translation(), "");
134          }          }
# Line 137  public class AttributeMetadataImpl exten Line 136  public class AttributeMetadataImpl exten
136          /**          /**
137           * Creates a new visible {@link AttributeMetadataImpl}           * Creates a new visible {@link AttributeMetadataImpl}
138           */           */
139          public AttributeMetadataImpl(final Name name, final String defaultTitle,          public AttributeMetadataImpl(final NameImpl name, final String defaultTitle,
140                          final List<String> langs) {                          final List<String> langs) {
141                  this(name, true, new Translation(langs, defaultTitle),                  this(name, true, new Translation(langs, defaultTitle),
142                                  new Translation(), "");                                  new Translation(), "");
# Line 185  public class AttributeMetadataImpl exten Line 184  public class AttributeMetadataImpl exten
184           * further down.           * further down.
185           */           */
186          @Override          @Override
187          public int compareTo(final AttributeMetadata atm2) {          public int compareTo(final AttributeMetadataInterface atm2) {
188                  return new Integer(weight).compareTo(new Double(atm2.getWeight())                  return new Integer(weight).compareTo(new Double(atm2.getWeight())
189                                  .intValue());                                  .intValue());
190          }          }
# Line 194  public class AttributeMetadataImpl exten Line 193  public class AttributeMetadataImpl exten
193           * @see Copyable inferface           * @see Copyable inferface
194           */           */
195          @Override          @Override
196          public AttributeMetadata copy() {          public AttributeMetadataInterface copy() {
197                  return copyTo(new AttributeMetadataImpl());                  return copyTo(new AttributeMetadataImpl());
198          }          }
199    
# Line 202  public class AttributeMetadataImpl exten Line 201  public class AttributeMetadataImpl exten
201           * @see Copyable inferface           * @see Copyable inferface
202           */           */
203          @Override          @Override
204          public AttributeMetadata copyTo(final AttributeMetadata amd) {          public AttributeMetadataInterface copyTo(final AttributeMetadataInterface amd) {
205                  getTitle().copyTo(amd.getTitle());                  getTitle().copyTo(amd.getTitle());
206                  getDesc().copyTo(amd.getDesc());                  getDesc().copyTo(amd.getDesc());
207                  amd.setUnit(getUnit());                  amd.setUnit(getUnit());

Legend:
Removed from v.769  
changed lines
  Added in v.772

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26