[Schmitzm-commits] r467 - branches/1.0-gt2-2.6/src/skrueger
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Oct 14 10:31:12 CEST 2009
Author: alfonx
Date: 2009-10-14 10:31:11 +0200 (Wed, 14 Oct 2009)
New Revision: 467
Modified:
branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java
Log:
* Removed the "int idx" parameter in accept method of the AttributeTypeFilter, because the AttributeMetadataMap is not based on the column-index any more.
Modified: branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java 2009-10-14 06:22:46 UTC (rev 466)
+++ branches/1.0-gt2-2.6/src/skrueger/AttributeMetaDataAttributeTypeFilter.java 2009-10-14 08:31:11 UTC (rev 467)
@@ -53,7 +53,7 @@
* Creates a new filter.
* @param attrMetaData the meta data of some attributes
*/
- public AttributeMetaDataAttributeTypeFilter(AttributeMetadata[] attrMetaData) {
+ public AttributeMetaDataAttributeTypeFilter(final AttributeMetadata[] attrMetaData) {
this.attrMetaDataMap = new AttributeMetadataMap();
for (int i=0; attrMetaData!=null && i<attrMetaData.length; i++)
this.attrMetaDataMap.put(attrMetaData[i].getName(), attrMetaData[i]);
@@ -63,7 +63,7 @@
* Creates a new filter.
* @param attrMetaData the meta data of some attributes
*/
- public AttributeMetaDataAttributeTypeFilter(AttributeMetadataMap attrMetaData) {
+ public AttributeMetaDataAttributeTypeFilter(final AttributeMetadataMap attrMetaData) {
this.attrMetaDataMap = attrMetaData;
}
@@ -71,14 +71,14 @@
* Returns {@code true} if the attribute meta data at index {@code idx} is
* visible and the attribute is no geometry at all.
*/
- public boolean accept(AttributeDescriptor type, int idx) {
+ public boolean accept(final AttributeDescriptor type) {
// if no meta data is given, all attributes (except Geometry)
- // are treaten as visible
+ // are treated as visible
if ( attrMetaDataMap == null )
- return NO_GEOMETRY.accept(type, idx);
+ return NO_GEOMETRY.accept(type);
- AttributeMetadata metaData = attrMetaDataMap.get(idx);
- return NO_GEOMETRY.accept(type, idx) // no geometry attributes at all
+ final AttributeMetadata metaData = attrMetaDataMap.get(type.getName());
+ return NO_GEOMETRY.accept(type) // no geometry attributes at all
&& metaData != null // meta data must be present for column
&& metaData.isVisible(); // attribute must be visible
}
More information about the Schmitzm-commits
mailing list