/[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 658 by alfonx, Wed Feb 3 15:32:21 2010 UTC revision 666 by alfonx, Wed Feb 3 18:05:50 2010 UTC
# Line 79  public class AttributeMetadata implement Line 79  public class AttributeMetadata implement
79           * be set and will always be interpreted as NULL internally and will usually           * be set and will always be interpreted as NULL internally and will usually
80           * be ignored. This overcomes the problem, that           * be ignored. This overcomes the problem, that
81           **/           **/
82          protected HashSet<Object> nodataValues = new HashSet<Object>();          protected final HashSet<Object> nodataValues = new HashSet<Object>();
83    
84          /** Translation of the attribute's title **/          /** Translation of the attribute's title **/
85          protected Translation title = new Translation();          protected Translation title = new Translation();
# Line 340  public class AttributeMetadata implement Line 340  public class AttributeMetadata implement
340                  this.name = name;                  this.name = name;
341          }          }
342    
343          public void setNodataValues(final HashSet<Object> nodataValues) {          public void addNodataValue(Object nodataValue) {
344                  this.nodataValues = nodataValues;                  this.nodataValues.add(nodataValue);
345            }
346            
347            public void removeNodataValue(Object nodataValue) {
348                    this.nodataValues.remove(nodataValue);
349          }          }
350    
351          public void setTitle(final Translation title) {          public void setTitle(final Translation title) {
# Line 387  public class AttributeMetadata implement Line 391  public class AttributeMetadata implement
391          }          }
392    
393          /**          /**
394           * Takes any value object and checks it againsts the NODATA values. If the           * Takes any value object and checks it against the NODATA values. If the
395           * value equals a NODATA value, <code>null</code> is returned. Otherwise the           * value equals a NODATA value, <code>null</code> is returned. Otherwise the
396           * same object is returned.           * same object is returned.
397           *           *
398           * Note: This method is called often.           * Note: This method is called often.
399           */           */
400          public Object fiterNodata(final Object value) {          public Object fiterNodata(final Object value) {
401                    if (nodataValues.contains(value)) return null;
                 // contains.. hash  
                 for (final Object nodataValue : getNodataValues()) {  
                         if (nodataValue.equals(value))  
                                 return null;  
                 }  
402                  return value;                  return value;
403          }          }
404  }  }

Legend:
Removed from v.658  
changed lines
  Added in v.666

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26