Revision 45155 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java
DefaultFeature.java | ||
---|---|---|
662 | 662 |
public Object get(String name) { |
663 | 663 |
int index = this.data.getType().getIndex(name); |
664 | 664 |
if( index < 0 ) { |
665 |
// buscamos en los extra cols |
|
666 |
if(hasExtraColumnValue(name)) { |
|
667 |
return getExtraColumnValue(name); |
|
668 |
} |
|
669 |
if (hasExtraValue(name)) { |
|
670 |
return getExtraValue(name); |
|
671 |
} |
|
672 |
// y si esta ahi return |
|
665 | 673 |
throw new IllegalArgumentException("Attribute name '"+name+"' not found in the feature."); |
666 | 674 |
} |
667 | 675 |
return this.get(index); |
... | ... | |
1247 | 1255 |
} |
1248 | 1256 |
this.extraValues.put(name, value); |
1249 | 1257 |
} |
1250 |
|
|
1251 |
@Override |
|
1252 |
public Object getExtraValue(String name) { |
|
1258 |
|
|
1259 |
public Object getExtraColumnValue(String name) { |
|
1253 | 1260 |
Object value; |
1254 | 1261 |
if( this.extraValues!=null ) { |
1255 | 1262 |
if( this.extraValues.containsKey(name) ) { |
... | ... | |
1274 | 1281 |
} |
1275 | 1282 |
return value; |
1276 | 1283 |
} |
1277 |
value = this.data.getExtraValue(name); |
|
1284 |
throw new RuntimeException("Not extra column value found"); |
|
1285 |
} |
|
1286 |
|
|
1287 |
@Override |
|
1288 |
public Object getExtraValue(String name) { |
|
1289 |
Object value = this.data.getExtraValue(name); |
|
1278 | 1290 |
return value; |
1279 | 1291 |
} |
1280 | 1292 |
|
1281 | 1293 |
@Override |
1282 | 1294 |
public boolean hasExtraValue(String name) { |
1295 |
return this.data.hasExtraValue(name); |
|
1296 |
} |
|
1297 |
|
|
1298 |
|
|
1299 |
private boolean hasExtraColumnValue(String name) { |
|
1283 | 1300 |
if( this.extraValues!=null ) { |
1284 | 1301 |
if( this.extraValues.containsKey(name) ) { |
1285 | 1302 |
return true; |
... | ... | |
1290 | 1307 |
if( index >= 0 ) { |
1291 | 1308 |
return true; |
1292 | 1309 |
} |
1293 |
return this.data.hasExtraValue(name);
|
|
1310 |
return false;
|
|
1294 | 1311 |
} |
1295 | 1312 |
|
1296 | 1313 |
@Override |
Also available in: Unified diff