Interface LenientComparable

All Known Implementing Classes:
Abstract­Completeness, Abstract­Content­Information, Abstract­Coordinate­Operation, Abstract­CRS, Abstract­CS, Abstract­Data­Evaluation, Abstract­Datum, Abstract­Element, Abstract­Geographic­Extent, Abstract­Geolocation­Information, Abstract­Identification, Abstract­Identified­Object, Abstract­Logical­Consistency, Abstract­Math­Transform, Abstract­Math­Transform​.Inverse, Abstract­Math­Transform1D, Abstract­Math­Transform1D​.Inverse, Abstract­Math­Transform2D, Abstract­Math­Transform2D​.Inverse, Abstract­Metadata, Abstract­Metaquality, Abstract­Parameter­Descriptor, Abstract­Party, Abstract­Positional­Accuracy, Abstract­Reference­System, Abstract­Result, Abstract­Spatial­Representation, Abstract­Temporal­Accuracy, Abstract­Temporal­Quality, Abstract­Thematic­Accuracy, Datum­Shift­Transform, Default­Absolute­External­Positional­Accuracy, Default­Accuracy­Of­ATime­Measurement, Default­Acquisition­Information, Default­Address, Default­Affine­CS, Default­Aggregate­Information, Default­Aggregation­Derivation, Default­Algorithm, Default­Application­Schema­Information, Default­Associated­Resource, Default­Attribute­Group, Default­Band, Default­Basic­Measure, Default­Bounding­Polygon, Default­Browse­Graphic, Default­Cartesian­CS, Default­Citation, Default­Citation­Date, Default­Completeness­Commission, Default­Completeness­Omission, Default­Compound­CRS, Default­Compound­CS, Default­Conceptual­Consistency, Default­Confidence, Default­Conformance­Result, Default­Constraints, Default­Contact, Default­Conversion, Default­Coordinate­System­Axis, Default­Coupled­Resource, Default­Coverage­Description, Default­Coverage­Result, Default­Cylindrical­CS, Default­Data­File, Default­Data­Identification, Default­Data­Quality, Default­Derived­CRS, Default­Descriptive­Result, Default­Digital­Transfer­Options, Default­Dimension, Default­Distribution, Default­Distributor, Default­Domain­Consistency, Default­Ellipsoid, Default­Ellipsoidal­CS, Default­Engineering­CRS, Default­Engineering­Datum, Default­Environmental­Record, Default­Evaluation­Method, Default­Evaluation­Report­Information, Default­Event, Default­Extended­Element­Information, Default­Extent, Default­Feature­Catalogue­Description, Default­Feature­Type­Info, Default­Format, Default­Format­Consistency, Default­Full­Inspection, Default­GCP, Default­GCPCollection, Default­Geocentric­CRS, Default­Geodetic­Datum, Default­Geographic­Bounding­Box, Default­Geographic­CRS, Default­Geographic­Description, Default­Geometric­Objects, Default­Georectified, Default­Georeferenceable, Default­Gridded­Data­Positional­Accuracy, Default­Grid­Spatial­Representation, Default­Homogeneity, Default­Identifier, Default­Image­CRS, Default­Image­Datum, Default­Image­Description, Default­Indirect­Evaluation, Default­Individual, Default­Instrument, Default­Keyword­Class, Default­Keywords, Default­Legal­Constraints, Default­Lineage, Default­Linear­CS, Default­Maintenance­Information, Default­Measure­Description, Default­Measure­Reference, Default­Medium, Default­Metadata, Default­Metadata­Extension­Information, Default­Metadata­Scope, Default­Nominal­Resolution, Default­Non­Quantitative­Attribute­Accuracy, Default­Non­Quantitative­Attribute­Correctness, Default­Object­Domain, Default­Objective, Default­Online­Resource, Default­Operation, Default­Operation­Chain­Metadata, Default­Operation­Metadata, Default­Operation­Method, Default­Organisation, Default­Parameter­Descriptor, Default­Parameter­Descriptor­Group, Default­Parameter­Value, Default­Parameter­Value­Group, Default­Parametric­CRS, Default­Parametric­CS, Default­Parametric­Datum, Default­Pass­Through­Operation, Default­Plan, Default­Platform, Default­Platform­Pass, Default­Polar­CS, Default­Portrayal­Catalogue­Reference, Default­Prime­Meridian, Default­Processing, Default­Process­Step, Default­Process­Step­Report, Default­Projected­CRS, Default­Quality­Measure, Default­Quantitative­Attribute­Accuracy, Default­Quantitative­Result, Default­Range­Dimension, Default­Range­Element­Description, Default­Relative­Internal­Positional­Accuracy, Default­Releasability, Default­Representativity, Default­Requested­Date, Default­Requirement, Default­Resolution, Default­Responsibility, Default­Responsible­Party, Default­Sample­Based­Inspection, Default­Sample­Dimension, Default­Scope, Default­Scope, Default­Scope­Description, Default­Security­Constraints, Default­Series, Default­Service­Identification, Default­Source, Default­Source­Reference, Default­Spatial­Temporal­Extent, Default­Spherical­CS, Default­Standard­Order­Process, Default­Telephone, Default­Temporal­Consistency, Default­Temporal­CRS, Default­Temporal­Datum, Default­Temporal­Extent, Default­Temporal­Validity, Default­Thematic­Classification­Correctness, Default­Time­CS, Default­Topological­Consistency, Default­Transformation, Default­Usability, Default­Usage, Default­User­Defined­CS, Default­Vector­Spatial­Representation, Default­Vertical­CRS, Default­Vertical­CS, Default­Vertical­Datum, Default­Vertical­Extent, Ellipsoid­To­Centric­Transform, Geohash­Reference­System, Grid­Extent, Grid­Geometry, Interpolated­Geocentric­Transform, Interpolated­Molodensky­Transform, Interpolated­Transform, ISOMetadata, Matrix1, Matrix2, Matrix3, Matrix4, Matrix­SIS, Military­Grid­Reference­System, Modifiable­Location­Type, Modifiable­Metadata, Molodensky­Transform, Pass­Through­Transform, Pole­Rotation, Referencing­By­Identifiers, Region­Of­Interest, Wraparound­Transform

public interface LenientComparable
Interfaces of classes for which instances can be compared for equality using different levels of strictness. For example, Math­Transform implementations can be compared ignoring some properties (remarks, etc.) that are not relevant to the coordinates calculation.

Conditions for equality

  • ISOMetadata subclasses
    1. STRICT – Objects must be of the same class and all attributes must be equal, including xlink and others identifiers.
    2. 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.
    3. IGNORE_METADATA – Only the attributes defined in the GeoAPI interfaces are compared. The above-cited identifiers and xlinks attributes are ignored.
    4. APPROXIMATE – The same attributes than the above IGNORE_METADATA mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
  • Abstract­Identified­Object subclasses
    1. STRICT – Objects must be of the same class and all attributes must be equal.
    2. 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.
    3. 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.
    4. APPROXIMATE – The same attributes than the above IGNORE_METADATA mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
  • Abstract­Math­Transform subclasses except Linear­Transform
    1. STRICT – Objects must be of the same class and all attributes must be equal, including the parameter values.
    2. BY_CONTRACT – Synonymous to the STRICT mode, because there is no GeoAPI interfaces for the various kind of math transforms.
    3. 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 on a sphere with a standard parallel value of 60° produces the same results than a "Mercator (1SP)" projection on the same sphere with a scale factor value of 0.5.
    4. APPROXIMATE – The same attributes than the above IGNORE_METADATA mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
  • Matrix­SIS and Linear­Transform implementations
    1. STRICT – Objects must be of the same class, matrixes must have the same size and all matrix elements must be equal.
    2. 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).
    3. IGNORE_METADATA – Synonymous to the BY_CONTRACT mode, because matrixes don't have metadata.
    4. APPROXIMATE – The same attributes than the above BY_CONTRACT mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
Since:
0.3
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Returns true if this object is strictly equals to the given object.
    boolean
    Compares this object with the given object for equality.
  • Method Details

    • equals

      boolean equals(Object other, ComparisonMode mode)
      Compares this object with the given object for equality. The strictness level is controlled by the second argument, from stricter to more permissive values:
      Description of comparison modes
      STRICT: All attributes of the compared objects shall be strictly equal.
      BY_CONTRACT: Only the attributes published in the interface contract need to be compared.
      IGNORE_METADATA: Only the attributes relevant to the object functionality are compared.
      APPROXIMATE: Only the attributes relevant to the object functionality are compared, with some tolerance threshold on numerical values.
      DEBUG: Special mode for figuring out why two objects expected to be equal are not.

      Conformance to the equals(Object) method contract

      Comparison­Mode​.STRICT is the only mode compliant with the Object​.equals(Object) contract. For all other modes m, the comparison is not guaranteed to be symmetric neither transitive:
      • x​.equals(y,m) is not guaranteed to be equal to y​.equals(x,m). In particular, the BY_CONTRACT mode and all modes below it will typically compare only the properties known to this instance, ignoring any properties that may be known only by the other instance.
      • x​.equals(y,m) and y​.equals(z,m) does not implies x​.equals(z,m). In particular, the use of a comparison threshold for the APPROXIMATE mode is incompatible with the transitivity contract.
      Parameters:
      other - the object to compare to this.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal according the given comparison mode.
      See Also:
    • equals

      boolean equals(Object other)
      Returns true if this object is strictly equals to the given object. This method is usually implemented as below:
      public boolean equals(Object other) {
          return equals(other, ComparisonMode.STRICT);
      }
      
      Implementers shall ensure that the following conditions hold. Unless the equals behavior is clearly documented in the interface javadoc (as for example in the Java collection framework), Comparison­Mode​.STRICT is the only reliable mode for this method implementation.
      • A​.equals(B) implies B​.equals(A);
      • A​.equals(B) and B​.equals(C) implies A​.equals(C);
      • A​.equals(B) implies A​.hash­Code() == B​.hash­Code();
      This method is declared final in most SIS implementations for ensuring that subclasses override the above equals(Object, Comparison­Mode) method instead than this one.
      Overrides:
      equals in class Object
      Parameters:
      other - the object to compare to this.
      Returns:
      true if both objects are strictly equal.
      See Also: