- All Known Implementing Classes:
AbstractCompleteness
,AbstractContentInformation
,AbstractCoordinateOperation
,AbstractCRS
,AbstractCS
,AbstractDataEvaluation
,AbstractDatum
,AbstractElement
,AbstractGeographicExtent
,AbstractGeolocationInformation
,AbstractIdentification
,AbstractIdentifiedObject
,AbstractLogicalConsistency
,AbstractMathTransform
,AbstractMathTransform.Inverse
,AbstractMathTransform1D
,AbstractMathTransform1D.Inverse
,AbstractMathTransform2D
,AbstractMathTransform2D.Inverse
,AbstractMetadata
,AbstractMetaquality
,AbstractParameterDescriptor
,AbstractParty
,AbstractPositionalAccuracy
,AbstractReferenceSystem
,AbstractResult
,AbstractSpatialRepresentation
,AbstractTemporalAccuracy
,AbstractTemporalQuality
,AbstractThematicAccuracy
,DatumShiftTransform
,DefaultAbsoluteExternalPositionalAccuracy
,DefaultAccuracyOfATimeMeasurement
,DefaultAcquisitionInformation
,DefaultAddress
,DefaultAffineCS
,DefaultAggregateInformation
,DefaultAggregationDerivation
,DefaultAlgorithm
,DefaultApplicationSchemaInformation
,DefaultAssociatedResource
,DefaultAttributeGroup
,DefaultBand
,DefaultBasicMeasure
,DefaultBoundingPolygon
,DefaultBrowseGraphic
,DefaultCartesianCS
,DefaultCitation
,DefaultCitationDate
,DefaultCompletenessCommission
,DefaultCompletenessOmission
,DefaultCompoundCRS
,DefaultCompoundCS
,DefaultConceptualConsistency
,DefaultConfidence
,DefaultConformanceResult
,DefaultConstraints
,DefaultContact
,DefaultConversion
,DefaultCoordinateSystemAxis
,DefaultCoupledResource
,DefaultCoverageDescription
,DefaultCoverageResult
,DefaultCylindricalCS
,DefaultDataFile
,DefaultDataIdentification
,DefaultDataQuality
,DefaultDerivedCRS
,DefaultDescriptiveResult
,DefaultDigitalTransferOptions
,DefaultDimension
,DefaultDistribution
,DefaultDistributor
,DefaultDomainConsistency
,DefaultEllipsoid
,DefaultEllipsoidalCS
,DefaultEngineeringCRS
,DefaultEngineeringDatum
,DefaultEnvironmentalRecord
,DefaultEvaluationMethod
,DefaultEvaluationReportInformation
,DefaultEvent
,DefaultExtendedElementInformation
,DefaultExtent
,DefaultFeatureCatalogueDescription
,DefaultFeatureTypeInfo
,DefaultFormat
,DefaultFormatConsistency
,DefaultFullInspection
,DefaultGCP
,DefaultGCPCollection
,DefaultGeocentricCRS
,DefaultGeodeticDatum
,DefaultGeographicBoundingBox
,DefaultGeographicCRS
,DefaultGeographicDescription
,DefaultGeometricObjects
,DefaultGeorectified
,DefaultGeoreferenceable
,DefaultGriddedDataPositionalAccuracy
,DefaultGridSpatialRepresentation
,DefaultHomogeneity
,DefaultIdentifier
,DefaultImageCRS
,DefaultImageDatum
,DefaultImageDescription
,DefaultIndirectEvaluation
,DefaultIndividual
,DefaultInstrument
,DefaultKeywordClass
,DefaultKeywords
,DefaultLegalConstraints
,DefaultLineage
,DefaultLinearCS
,DefaultMaintenanceInformation
,DefaultMeasureDescription
,DefaultMeasureReference
,DefaultMedium
,DefaultMetadata
,DefaultMetadataExtensionInformation
,DefaultMetadataScope
,DefaultNominalResolution
,DefaultNonQuantitativeAttributeAccuracy
,DefaultNonQuantitativeAttributeCorrectness
,DefaultObjectDomain
,DefaultObjective
,DefaultOnlineResource
,DefaultOperation
,DefaultOperationChainMetadata
,DefaultOperationMetadata
,DefaultOperationMethod
,DefaultOrganisation
,DefaultParameterDescriptor
,DefaultParameterDescriptorGroup
,DefaultParameterValue
,DefaultParameterValueGroup
,DefaultParametricCRS
,DefaultParametricCS
,DefaultParametricDatum
,DefaultPassThroughOperation
,DefaultPlan
,DefaultPlatform
,DefaultPlatformPass
,DefaultPolarCS
,DefaultPortrayalCatalogueReference
,DefaultPrimeMeridian
,DefaultProcessing
,DefaultProcessStep
,DefaultProcessStepReport
,DefaultProjectedCRS
,DefaultQualityMeasure
,DefaultQuantitativeAttributeAccuracy
,DefaultQuantitativeResult
,DefaultRangeDimension
,DefaultRangeElementDescription
,DefaultRelativeInternalPositionalAccuracy
,DefaultReleasability
,DefaultRepresentativity
,DefaultRequestedDate
,DefaultRequirement
,DefaultResolution
,DefaultResponsibility
,DefaultResponsibleParty
,DefaultSampleBasedInspection
,DefaultSampleDimension
,DefaultScope
,DefaultScope
,DefaultScopeDescription
,DefaultSecurityConstraints
,DefaultSeries
,DefaultServiceIdentification
,DefaultSource
,DefaultSourceReference
,DefaultSpatialTemporalExtent
,DefaultSphericalCS
,DefaultStandardOrderProcess
,DefaultTelephone
,DefaultTemporalConsistency
,DefaultTemporalCRS
,DefaultTemporalDatum
,DefaultTemporalExtent
,DefaultTemporalValidity
,DefaultThematicClassificationCorrectness
,DefaultTimeCS
,DefaultTopologicalConsistency
,DefaultTransformation
,DefaultUsability
,DefaultUsage
,DefaultUserDefinedCS
,DefaultVectorSpatialRepresentation
,DefaultVerticalCRS
,DefaultVerticalCS
,DefaultVerticalDatum
,DefaultVerticalExtent
,EllipsoidToCentricTransform
,GeohashReferenceSystem
,GridExtent
,GridGeometry
,InterpolatedGeocentricTransform
,InterpolatedMolodenskyTransform
,InterpolatedTransform
,ISOMetadata
,Matrix1
,Matrix2
,Matrix3
,Matrix4
,MatrixSIS
,MilitaryGridReferenceSystem
,ModifiableLocationType
,ModifiableMetadata
,MolodenskyTransform
,PassThroughTransform
,PoleRotation
,ReferencingByIdentifiers
,RegionOfInterest
,WraparoundTransform
public interface LenientComparable
Interfaces of classes for which instances 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
ISOMetadata
subclassesSTRICT
– Objects must be of the same class and all attributes must be equal, includingxlink
and others identifiers.BY_CONTRACT
– The same attributes than the aboveSTRICT
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 andxlinks
attributes are ignored.APPROXIMATE
– The same attributes than the aboveIGNORE_METADATA
mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
AbstractIdentifiedObject
subclassesSTRICT
– Objects must be of the same class and all attributes must be equal.BY_CONTRACT
– The same attributes than the aboveSTRICT
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.APPROXIMATE
– The same attributes than the aboveIGNORE_METADATA
mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
AbstractMathTransform
subclasses exceptLinearTransform
STRICT
– Objects must be of the same class and all attributes must be equal, including the parameter values.BY_CONTRACT
– Synonymous to theSTRICT
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 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.APPROXIMATE
– The same attributes than the aboveIGNORE_METADATA
mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
MatrixSIS
andLinearTransform
implementationsSTRICT
– 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 (anyMatrix
is okay).IGNORE_METADATA
– Synonymous to theBY_CONTRACT
mode, because matrixes don't have metadata.APPROXIMATE
– The same attributes than the aboveBY_CONTRACT
mode are compared, but a slight (implementation dependant) difference is tolerated in floating point numbers.
- Since:
- 0.3
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if this object is strictly equals to the given object.boolean
equals
(Object other, ComparisonMode mode) Compares this object with the given object for equality.
-
Method Details
-
equals
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 contractComparisonMode.STRICT
is the only mode compliant with theObject.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 toy.equals(x,m)
. In particular, theBY_CONTRACT
mode and all modes below it will typically compare only the properties known tothis
instance, ignoring any properties that may be known only by the other instance.x.equals(y,m)
andy.equals(z,m)
does not impliesx.equals(z,m)
. In particular, the use of a comparison threshold for theAPPROXIMATE
mode is incompatible with the transitivity contract.
- Parameters:
other
- the object to compare tothis
.mode
- the strictness level of the comparison.- Returns:
true
if both objects are equal according the given comparison mode.- See Also:
-
equals
Returnstrue
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); }
equals
behavior is clearly documented in the interface javadoc (as for example in the Java collection framework),ComparisonMode.STRICT
is the only reliable mode for this method implementation.A.equals(B)
impliesB.equals(A)
;A.equals(B)
andB.equals(C)
impliesA.equals(C)
;A.equals(B)
impliesA.hashCode() == B.hashCode()
;
final
in most SIS implementations for ensuring that subclasses override the aboveequals(Object, ComparisonMode)
method instead than this one.
-