DefaultResolution changes for revisions 24972:24990

Replacement of Number type by Double. This change has been forced by a GeoAPI change. Reverting this change causes a compilation failure, which is resolved by restoring the Double values as required by GeoAPI interfaces. So rewriting this contribution produces identical result regarding this aspect.

The "Values greater than 1…" comment has been removed, and the hashCode() implementation from this contribution has been removed too.

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" -r24972:24990 https://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/metadata/iso/identification/ResolutionImpl.java
Revision 24972Revision 24990
 * Only one of {@linkplain #getEquivalentScale equivalent scale} and
 * {@linkplain #getDistance ground sample distance} may be provided.
 */
private double distance;

/**
 * Constructs an initially empty Resolution.
 * Only one of {@linkplain #getEquivalentScale equivalent scale} and
 * {@linkplain #getDistance ground sample distance} may be provided.
 */
private Double distance;

/**
 * Constructs an initially empty Resolution.
/**
 * Set the level of detail expressed as the scale of a comparable hardcopy map or chart.
 */
public synchronized void setEquivalentScale(final double newValue) {
    checkWritePermission();
/**
 * Set the level of detail expressed as the scale of a comparable hardcopy map or chart.
 *
 * Values greater than 1 will be stored as (1 / newValue), values less than one will be stored as is.
 */
public synchronized void setEquivalentScale(final double newValue) {
    checkWritePermission();
}

/**
 * Ground sample distance.
 * Only one of {@linkplain #getEquivalentScale equivalent scale} and
 * {@linkplain #getDistance ground sample distance} may be provided.
 */
public double getDistance() {
    return distance;
}

/**
 * Set the ground sample distance.
 */
public synchronized void setDistance(final double newValue) {
    checkWritePermission();
    distance = newValue;
}
}

/**
 * Set the level of detail expressed as the scale of a comparable hardcopy map or chart.
 */
public synchronized void setEquivalentScale(final RepresentativeFraction newValue) {
    checkWritePermission();
    equivalentScale = newValue;
}

/**
 * Ground sample distance.
 * Only one of {@linkplain #getEquivalentScale equivalent scale} and
 * {@linkplain #getDistance ground sample distance} may be provided.
 */
public Double getDistance() {
    return distance;
}

/**
 * Set the ground sample distance.
 */
public synchronized void setDistance(final Double newValue) {
    checkWritePermission();
    distance = newValue;
}
 */
public synchronized int hashCode() {
    int code = (int)serialVersionUID;
    code ^= (int)equivalentScale.hashCode();
    code ^= (int)distance;
    return code;
}
 */
public synchronized int hashCode() {
    int code = (int)serialVersionUID;
    if (equivalentScale != null) {
    code ^= (int)equivalentScale.hashCode();
    }
    if (distance != null) {
        code ^= distance.intValue();
    }
    return code;
}