public class PointMatcher extends Object
PointMatcher object.| Modifier and Type | Field and Description |
|---|---|
protected Point2D |
point
The point stored by the
PointMatcher |
| Constructor and Description |
|---|
PointMatcher(Point2D p)
Creates a
PointMatcher object using the given point
p. |
| Modifier and Type | Method and Description |
|---|---|
Point2D |
getPoint()
Get the point that this
PointMatcher object uses to define the
matching criteria. |
boolean |
matches(Point2D other)
Checks whether or not the point
other matches the point held
by this PointMatcher. |
void |
setPoint(Point2D p)
Set the point that this
PointMatcher object uses to define the
matching criteria. |
protected Point2D point
PointMatcherpublic PointMatcher(Point2D p)
PointMatcher object using the given point
p. The point p is used by the matcher to define
the matching criteria. This class matches points that are equal to
p, but subclasses are expected to define different matching
criteria.p - the point to matchpublic Point2D getPoint()
PointMatcher object uses to define the
matching criteria. Clients cannot use this method to modify the point;
clients must use setPoint to modify the point that this
PointMatcher object matches.PointMatcher uses to define the
matching criteria.public void setPoint(Point2D p)
PointMatcher object uses to define the
matching criteria.p - the point that this PointMatcher should use to define
the matching criteria.public boolean matches(Point2D other)
other matches the point held
by this PointMatcher. This PointMatcher uses
equals to determine if its point matches other,
but subclasses of PointMatcher are expected to change this
behavior.other - the point to check for a matchtrue if this PointMatcher's point is
equal to other