--- branches/2.0-RC2/src/skrueger/AttributeMetadata.java 2010/02/03 15:32:21 658 +++ branches/2.0-RC2/src/skrueger/AttributeMetadata.java 2010/02/03 18:05:50 666 @@ -79,7 +79,7 @@ * be set and will always be interpreted as NULL internally and will usually * be ignored. This overcomes the problem, that **/ - protected HashSet nodataValues = new HashSet(); + protected final HashSet nodataValues = new HashSet(); /** Translation of the attribute's title **/ protected Translation title = new Translation(); @@ -340,8 +340,12 @@ this.name = name; } - public void setNodataValues(final HashSet nodataValues) { - this.nodataValues = nodataValues; + public void addNodataValue(Object nodataValue) { + this.nodataValues.add(nodataValue); + } + + public void removeNodataValue(Object nodataValue) { + this.nodataValues.remove(nodataValue); } public void setTitle(final Translation title) { @@ -387,19 +391,14 @@ } /** - * 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 * value equals a NODATA value, null is returned. Otherwise the * same object is returned. * * Note: This method is called often. */ public Object fiterNodata(final Object value) { - - // contains.. hash - for (final Object nodataValue : getNodataValues()) { - if (nodataValue.equals(value)) - return null; - } + if (nodataValues.contains(value)) return null; return value; } }