Package org.geolatte.geom
Class GeometryPositionEquality
- java.lang.Object
-
- org.geolatte.geom.GeometryPositionEquality
-
- All Implemented Interfaces:
GeometryEquality
- Direct Known Subclasses:
ApproximateGeometryEquality
public class GeometryPositionEquality extends Object implements GeometryEquality
AGeometryEqualitythat considers twoGeometrys to be equal iff one of these conditions is satisfied:- both have the same type, coordinate reference system and consist of the same
Points. - both are empty
Point equality is determined by the
PositionEqualityinstance that is passed to the constructor. In case of the default no-args constructor,ExactPositionEqualityis used.- Author:
- Karel Maesen, Geovise BVBA creation-date: 4/25/12
-
-
Constructor Summary
Constructors Constructor Description GeometryPositionEquality()Constructs an instance that usesExactPositionEqualityto determine whether theGeometrys have the samePositionss.GeometryPositionEquality(PositionEquality pointEq)Constructs an instance that uses the specifiedPositionEqualityto determine whether theGeometrys have the samePositionss.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <P extends Position>
booleanequals(Geometry<P> first, Geometry<P> second)Checks whether the first geometry equals the second, for some definition of equality.
-
-
-
Constructor Detail
-
GeometryPositionEquality
public GeometryPositionEquality(PositionEquality pointEq)
Constructs an instance that uses the specifiedPositionEqualityto determine whether theGeometrys have the samePositionss.- Parameters:
pointEq-
-
GeometryPositionEquality
public GeometryPositionEquality()
Constructs an instance that usesExactPositionEqualityto determine whether theGeometrys have the samePositionss.
-
-
Method Detail
-
equals
public <P extends Position> boolean equals(Geometry<P> first, Geometry<P> second)
Checks whether the first geometry equals the second, for some definition of equality.- Specified by:
equalsin interfaceGeometryEquality- Parameters:
first- aGeometrysecond- a secondGeometry- Returns:
- true if and only if both both
Geometrys are equal.
-
-