Class Circle

java.lang.Object
com.aoapps.html.any.Circle
All Implemented Interfaces:
Shape, Serializable

public class Circle extends Object implements Shape, Serializable
Minimal implementation of a circle class for similarity to Rectangle. Methods are implemented via Ellipse2D.
Author:
AO Industries, Inc.
See Also:
  • Constructor Details

    • Circle

      public Circle(int x, int y, int radius)
  • Method Details

    • getX

      public int getX()
    • getY

      public int getY()
    • getRadius

      public int getRadius()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Returns a String representing this Circle and its values.
      Overrides:
      toString in class Object
      Returns:
      a String representing this Circle object's coordinate and radius values.
    • getEllipse

      public Ellipse2D getEllipse()
    • getBounds

      public Rectangle getBounds()
      Specified by:
      getBounds in interface Shape
    • getBounds2D

      public Rectangle2D getBounds2D()
      Specified by:
      getBounds2D in interface Shape
    • contains

      public boolean contains(double x, double y)
      Specified by:
      contains in interface Shape
    • contains

      public boolean contains(Point2D p)
      Specified by:
      contains in interface Shape
    • intersects

      public boolean intersects(double x, double y, double w, double h)
      Specified by:
      intersects in interface Shape
    • intersects

      public boolean intersects(Rectangle2D r)
      Specified by:
      intersects in interface Shape
    • contains

      public boolean contains(double x, double y, double w, double h)
      Specified by:
      contains in interface Shape
    • contains

      public boolean contains(Rectangle2D r)
      Specified by:
      contains in interface Shape
    • getPathIterator

      public PathIterator getPathIterator(AffineTransform at)
      Specified by:
      getPathIterator in interface Shape
    • getPathIterator

      public PathIterator getPathIterator(AffineTransform at, double flatness)
      Specified by:
      getPathIterator in interface Shape