Revision 24759 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableNumericFieldOperations.java
TableNumericFieldOperations.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig; |
2 | 2 |
|
3 | 3 |
import java.math.BigDecimal; |
4 |
import java.sql.Types; |
|
5 | 4 |
import java.util.BitSet; |
6 | 5 |
import java.util.Iterator; |
7 | 6 |
|
8 |
import org.gvsig.fmap.data.ReadException; |
|
9 |
import org.gvsig.fmap.data.feature.Feature; |
|
10 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
11 |
import org.gvsig.fmap.data.feature.FeatureCollection; |
|
12 |
import org.gvsig.fmap.data.feature.FeatureStore; |
|
7 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
8 |
import org.gvsig.fmap.dal.feature.Feature; |
|
9 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
13 | 11 |
import org.gvsig.fmap.mapcontext.rendering.legend.NullValue; |
12 |
import org.opengis.feature.FeatureCollection; |
|
14 | 13 |
|
15 | 14 |
import com.iver.andami.PluginServices; |
16 |
import com.iver.andami.messages.NotificationManager; |
|
17 | 15 |
import com.iver.andami.plugins.Extension; |
18 | 16 |
import com.iver.andami.ui.mdiManager.IWindow; |
19 | 17 |
import com.iver.cit.gvsig.project.documents.table.gui.Statistics; |
... | ... | |
88 | 86 |
double d=number.doubleValue(); |
89 | 87 |
numRows++; |
90 | 88 |
suma = suma.add(new BigDecimal(d)); |
91 |
if (d < min.doubleValue()) min = new BigDecimal(d); |
|
92 |
if (d > max.doubleValue()) max = new BigDecimal(d); |
|
89 |
if (d < min.doubleValue()) { |
|
90 |
min = new BigDecimal(d); |
|
91 |
} |
|
92 |
if (d > max.doubleValue()) { |
|
93 |
max = new BigDecimal(d); |
|
94 |
} |
|
93 | 95 |
} |
94 | 96 |
}else{ |
95 | 97 |
|
... | ... | |
110 | 112 |
double d=number.doubleValue(); |
111 | 113 |
numRows++; |
112 | 114 |
suma = suma.add(new BigDecimal(d)); |
113 |
if (d < min.doubleValue()) min = new BigDecimal(d); |
|
114 |
if (d > max.doubleValue()) max = new BigDecimal(d); |
|
115 |
if (d < min.doubleValue()) { |
|
116 |
min = new BigDecimal(d); |
|
117 |
} |
|
118 |
if (d > max.doubleValue()) { |
|
119 |
max = new BigDecimal(d); |
|
120 |
} |
|
115 | 121 |
} |
116 | 122 |
} |
117 | 123 |
Statistics st = new Statistics(); |
... | ... | |
224 | 230 |
if (indices.cardinality() == 1){ |
225 | 231 |
// try { |
226 | 232 |
int index=indices.nextSetBit(0); |
227 |
if (table.getModel().getModel().getDefaultFeatureType().size()<index+1) |
|
233 |
if (table.getModel().getModel().getDefaultFeatureType().size()<index+1) {
|
|
228 | 234 |
return false; |
235 |
} |
|
229 | 236 |
String type = ((FeatureAttributeDescriptor)table.getModel().getModel().getDefaultFeatureType().get(index)).getDataType(); |
230 | 237 |
if ((type.equals(FeatureAttributeDescriptor.TYPE_LONG)) || |
231 | 238 |
(type.equals(FeatureAttributeDescriptor.TYPE_DOUBLE)) || |
Also available in: Unified diff