/** * Determines whether the specified {@link Point} is inside this * <code>Polygon</code>. * @param p the specified <code>Point</code> to be tested * @return <code>true</code> if the <code>Polygon</code> contains the * <code>Point</code>; <code>false</code> otherwise. * @see #contains(double, double) * */ public boolean contains(Point p) { return contains(p.x, p.y); }
/** * Determines whether the specified coordinates are inside this * <code>Polygon</code>. * <p> * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested * @return {@code true} if this {@code Polygon} contains * the specified coordinates {@code (x,y)}; * {@code false} otherwise. * @see #contains(double, double) * */ public boolean contains(int x, int y) { return contains((double) x, (double) y); }
/** * {@inheritDoc} * */ @Override public boolean contains(Point2D p) { return contains(p.getX(), p.getY()); }
/** * {@inheritDoc} * */ @Override public boolean contains(Rectangle2D r) { return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); }