DefaultQuantitativeResult changes for revisions 24924:24925

This commit propagates method signatures changes which were done in GeoAPI. Reverting this commit cause compilation errors, which are resolved by modifying the method signatures as in this commit. Those signatures can only be the same, however the method bodies are different in Geotk/SIS.

The freeze and equals methods do not exist anymore in Geotk/SIS.

Action: all contributions forced by changes in GeoAPI interfaces (mostly import statements and method signatures) have been rewritten from scratch by creating an empty Java class implementing the interface, clicking on the "Implement all abstract methods" contextual menu in NetBeans, removing the <? extends> part in parameterized type of collections, adding the synchronized keyword (for now) and finally adding the corresponding private fields. This action has been committed in the Apache SIS JDK7 branch at revision 1458238.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r24924:24925 https://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/metadata/iso/quality/QuantitativeResultImpl.java
Revision 24924Revision 24925
package org.geotools.metadata.iso.quality;

// J2SE dependencies and extension
import java.util.Arrays;
import javax.units.Unit;

// OpenGIS dependencies
import org.opengis.metadata.quality.QuantitativeResult;
import org.opengis.util.InternationalString;

// Geotools dependencies
import org.geotools.resources.Utilities;
package org.geotools.metadata.iso.quality;

// J2SE dependencies and extension
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import javax.units.Unit;

// OpenGIS dependencies
import org.opengis.metadata.quality.QuantitativeResult;
import org.opengis.util.InternationalString;
import org.opengis.util.RecordType;

// Geotools dependencies
import org.geotools.resources.Utilities;
/**
 * Quantitative value or values, content determined by the evaluation procedure used.
 */
private double[] values;

/**
 * Value type for reporting a data quality result, or {@code null} if none.
 */
private Class valueType;

/**
 * Value unit for reporting a data quality result, or {@code null} if none.
/**
 * Quantitative value or values, content determined by the evaluation procedure used.
 */
private List/*<Double>*/ values;

/**
 * Value type for reporting a data quality result, or {@code null} if none.
 */
private RecordType valueType;

/**
 * Value unit for reporting a data quality result, or {@code null} if none.
/**
 * Quantitative value or values, content determined by the evaluation procedure used.
 */
public synchronized double[] getValues() {
    if (isModifiable()) {
        return values;
    } else {
        return (double[]) values.clone();
    }
}
/**
 * Quantitative value or values, content determined by the evaluation procedure used.
 */
public synchronized Collection getValues() {
    if (isModifiable()) {
        return values;
    } else {
        return Collections.unmodifiableList( values );
    }
}
 */
public synchronized void setValues(final double[] newValues) {
    checkWritePermission();
    values = (double[]) newValues.clone();
}

/**
 * Value type for reporting a data quality result, or {@code null} if none.
 */
public Class getValueType()  {
    return valueType;
}
 */
public synchronized void setValues(final double[] newValues) {
    checkWritePermission();
    values = new ArrayList();
    for( int i=0; i<newValues.length;i++){
        values.add( new Double( newValues[i]));
}
}

public synchronized void setValues( List newValues ){
    values = newValues;
}

/**
 * Value type for reporting a data quality result, or {@code null} if none.
 */
public RecordType getValueType()  {
    return valueType;
}
 *
 * @todo Verify if the value is of the requested type.
 */
public synchronized void setValueType(final Class newValue) {
    checkWritePermission();
    valueType = newValue;
}
 *
 * @todo Verify if the value is of the requested type.
 */
public synchronized void setValueType(final RecordType newValue) {
    checkWritePermission();
    valueType = newValue;
}
 */
protected void freeze() {
    super.freeze();
    values         = (double[])            unmodifiable(values);
    valueType      = (Class)               unmodifiable(valueType);
    valueUnit      = (Unit)                unmodifiable(valueUnit);
    errorStatistic = (InternationalString) unmodifiable(errorStatistic);
}
 */
protected void freeze() {
    super.freeze();
    values         = (List)            unmodifiable(values);
    valueType      = (RecordType)          unmodifiable(valueType);
    valueUnit      = (Unit)                unmodifiable(valueUnit);
    errorStatistic = (InternationalString) unmodifiable(errorStatistic);
}
}
if (object!=null && object.getClass().equals(getClass())) {
    final QuantitativeResultImpl that = (QuantitativeResultImpl) object;
    return    Arrays.equals(this.values,         that.values         ) &&
           Utilities.equals(this.valueType,      that.valueType      ) &&
           Utilities.equals(this.valueUnit,      that.valueUnit      ) &&
           Utilities.equals(this.errorStatistic, that.errorStatistic ) ;
}
if (object!=null && object.getClass().equals(getClass())) {
    final QuantitativeResultImpl that = (QuantitativeResultImpl) object;
    return Utilities.equals(this.values,         that.values         ) &&
           Utilities.equals(this.valueType,      that.valueType      ) &&
           Utilities.equals(this.valueUnit,      that.valueUnit      ) &&
           Utilities.equals(this.errorStatistic, that.errorStatistic ) ;