org.geotoolkit.util
Interface LenientComparable

All Superinterfaces:
LenientComparable
All Known Subinterfaces:
LinearTransform, XMatrix
All Known Implementing Classes:
AffineTransform2D, GeneralMatrix, GeocentricAffineTransform, LinearTransform1D, Matrix1, Matrix2, Matrix3, Matrix4, ProjectiveTransform

Deprecated. Moved to Apache SIS LenientComparable.

@Deprecated
public interface LenientComparable
extends LenientComparable

Indicates that this object can be compared for equality using different levels of strictness. For example MathTransform implementations can be compared ignoring some properties (remarks, etc.) that are not relevant to the coordinates calculation.


Conditions for equality

MetadataEntity subclasses:

STRICT: Objects must be of the same class and all attributes must be equal, including identifiers.
BY_CONTRACT: The same attributes than the above STRICT mode must be equal, but the metadata object don't need to be implemented by the same class, provided that they implement the same GeoAPI interface.
IGNORE_METADATA: Only the attributes defined in the GeoAPI interfaces are compared. The above-cited identifiers and xlinks attributes are ignored.
APPROXIMATIVE: The same attributes than the above IGNORE_METADATA mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.

 

AbstractIdentifiedObject subclasses:

STRICT: Objects must be of the same class and all attributes must be equal.
BY_CONTRACT: The same attributes than the above STRICT mode must be equal, but the referencing object don't need to be implemented by the same class, provided that they implement the same GeoAPI interface.
IGNORE_METADATA: The identifiers, aliases, scope, domain of validity and remarks are ignored because they have no incidence on the coordinate values to be computed by coordinate operations. All other attributes that are relevant to coordinate calculations, must be equal.
APPROXIMATIVE: The same attributes than the above IGNORE_METADATA mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.

 

AbstractMathTransform subclasses except LinearTransform:

STRICT: Objects must be of the same class and all attributes must be equal, including the parameter values.
BY_CONTRACT: Synonymous to the STRICT mode, because there is no GeoAPI interfaces for the various kind of math transforms.
IGNORE_METADATA: Objects must be of the same class, but the parameter values can be different if they are different way to formulate the same transform. For example a "Mercator (2SP)" projection with a standard parallel value of 60° produces the same results than a "Mercator (1SP)" projection with a scale factor value of 0.5
APPROXIMATIVE: The same attributes than the above IGNORE_METADATA mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.

 

XMatrix and LinearTransform implementations:

STRICT: Objects must be of the same class, matrixes must have the same size and all matrix elements must be equal.
BY_CONTRACT: Matrixes must have the same size and all matrix elements must be equal, but the matrixes are not required to be the same implementation class (any Matrix is okay).
IGNORE_METADATA: Synonymous to the BY_CONTRACT mode, because matrixes don't have metadata.
APPROXIMATIVE: The same attributes than the above BY_CONTRACT mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.

Since:
3.18
Version:
3.18
Author:
Martin Desruisseaux (Geomatys)
Module:
utility/geotk-utility (download)    View source code for this class

Method Summary
 boolean equals(Object other)
          Deprecated. Returns true if this object is strictly equals to the given object.
 boolean equals(Object other, ComparisonMode mode)
          Deprecated. Compares this object with the given object for equality.
 

Method Detail

equals

boolean equals(Object other,
               ComparisonMode mode)
Deprecated. 
Compares this object with the given object for equality. The strictness level is controlled by the second argument.

Specified by:
equals in interface LenientComparable
Parameters:
other - The object to compare to this.
mode - The strictness level of the comparison.
Returns:
true if both objects are equal.
See Also:
Utilities.deepEquals(Object, Object, ComparisonMode)

equals

boolean equals(Object other)
Deprecated. 
Returns true if this object is strictly equals to the given object. This method is typically implemented as below:
return equals(other, ComparisonMode.STRICT);
In Geotk implementations, this method is typically final in order to ensure that subclasses override the above equals(Object, ComparisonMode) method instead.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class Object
Parameters:
other - The object to compare to this.
Returns:
true if both objects are strictly equal.
See Also:
ComparisonMode.STRICT


Copyright © 2009-2013 Geotoolkit.org. All Rights Reserved.