public class PointImpl extends BaseShape<SpatialContext> implements Point
| Constructor and Description |
|---|
PointImpl(double x,
double y,
SpatialContext ctx)
A simple constructor without normalization / validation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
The sub-classes of Shape generally implement the
same contract for
Object.equals(Object) and Object.hashCode()
amongst the same sub-interface type. |
static boolean |
equals(Point thiz,
Object o)
All
Point implementations should use this definition of Object.equals(Object). |
double |
getArea(SpatialContext ctx)
Calculates the area of the shape, in square-degrees.
|
Rectangle |
getBoundingBox()
Get the bounding box for this Shape.
|
Circle |
getBuffered(double distance,
SpatialContext ctx)
Returns a buffered version of this shape.
|
PointImpl |
getCenter()
Returns the center point of this shape.
|
double |
getX()
The X coordinate, or Longitude in geospatial contexts.
|
double |
getY()
The Y coordinate, or Latitude in geospatial contexts.
|
boolean |
hasArea()
Does the shape have area? This will be false for points and lines.
|
int |
hashCode() |
static int |
hashCode(Point thiz)
All
Point implementations should use this definition of Object.hashCode(). |
boolean |
isEmpty()
Shapes can be "empty", which is to say it exists nowhere.
|
SpatialRelation |
relate(Shape other)
Describe the relationship between the two objects.
|
void |
reset(double x,
double y)
Expert: Resets the state of this shape given the arguments.
|
String |
toString() |
getContextclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContextpublic PointImpl(double x,
double y,
SpatialContext ctx)
public boolean isEmpty()
Shapepublic void reset(double x,
double y)
Pointpublic double getX()
Pointpublic double getY()
Pointpublic Rectangle getBoundingBox()
Shapethis.getBoundingBox().relate(this) == CONTAINSgetBoundingBox in interface Shapepublic PointImpl getCenter()
ShapegetBoundingBox().getCenter() but it doesn't have to be.
Postcondition: this.relate(this.getCenter()) == CONTAINSpublic Circle getBuffered(double distance, SpatialContext ctx)
ShapegetBuffered in interface Shapepublic SpatialRelation relate(Shape other)
Shapepublic boolean hasArea()
Shapepublic double getArea(SpatialContext ctx)
Shapepublic boolean equals(Object o)
ShapeObject.equals(Object) and Object.hashCode()
amongst the same sub-interface type. This means, for example, that multiple
Point implementations of different classes are equal if they share the same x
& y.public static boolean equals(Point thiz, Object o)
Point implementations should use this definition of Object.equals(Object).public static int hashCode(Point thiz)
Point implementations should use this definition of Object.hashCode().Copyright © 2025. All rights reserved.