private Feature totalNumericValues(FeatureCollection fc, Feature feature) {
        FeatureSchema schema = fc.getFeatureSchema();
        for (Iterator it = fc.iterator() ; it.hasNext() ; ) {
            Feature f = (Feature)it.next();
            for (int i = 0, max = schema.getAttributeCount() ; i < max ; i++) {
                if (schema.getAttributeType(i) == AttributeType.INTEGER) {
                    Object val = feature.getAttribute(i);
                    int val1 = (val ==  null)? 0 : ((Integer)val).intValue();
                    val = f.getAttribute(i);
                    val1 = (val == null)? val1 : val1 + ((Integer)val).intValue();
                    feature.setAttribute(i, new Integer(val1));
                }
                else if (schema.getAttributeType(i) == AttributeType.DOUBLE) {
                    Object val = feature.getAttribute(i);
                    double val1 = (val ==  null)? 0 : ((Double)val).doubleValue();
                    val = f.getAttribute(i);
                    val1 = (val == null)? val1 : val1 + ((Double)val).doubleValue();
                    feature.setAttribute(i, new Double(val1));
                }
            }
        }
        return feature;
    }