类 Circle
java.lang.Object
com.example.graphics.model.Circle
- 所有已实现的接口:
Shape
Circle implementation of the Shape interface.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
accept
(ShapeVisitor visitor) Accept method for the Visitor patternclone()
Clone the shapeint
Get the radius of the circleint
getX()
Get the x coordinate of the shapeint
getY()
Get the y coordinate of the shapevoid
setPosition
(int x, int y) Set the position of the shapevoid
setRadius
(int radius) Set the radius of the circle
-
字段详细资料
-
x
private int x -
y
private int y -
radius
private int radius
-
-
构造器详细资料
-
Circle
public Circle(int x, int y, int radius) Constructs a circle with the specified parameters- 参数:
x
- the x coordinate of the centery
- the y coordinate of the centerradius
- the radius of the circle
-
-
方法详细资料
-
getX
public int getX()从接口复制的说明:Shape
Get the x coordinate of the shape -
getY
public int getY()从接口复制的说明:Shape
Get the y coordinate of the shape -
setPosition
public void setPosition(int x, int y) 从接口复制的说明:Shape
Set the position of the shape- 指定者:
setPosition
在接口中Shape
- 参数:
x
- the x coordinatey
- the y coordinate
-
getRadius
public int getRadius()Get the radius of the circle- 返回:
- the radius
-
setRadius
public void setRadius(int radius) Set the radius of the circle- 参数:
radius
- the new radius
-
accept
从接口复制的说明:Shape
Accept method for the Visitor pattern -
clone
从接口复制的说明:Shape
Clone the shape
-