|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectyu.ac.bg.etf.javaqx.qswing.graphics.Point
Point Class.
NOTE: This class is immutable.
Field Summary | |
static Point |
ZERO_POINT
Point(0, 0) object. |
Constructor Summary | |
Point()
Constructs new Point object. |
|
Point(int x,
int y)
Constructs new Point object. |
Method Summary | |
double |
distance(int px,
int py)
Returns the distance from this point to a specified point. |
double |
distance(Point p)
Returns the distance from this point to a specified point. |
double |
distanceSq(int px,
int py)
Returns the square distance from this point to a specified point. |
double |
distanceSq(Point p)
Returns the square distance from this point to a specified point. |
boolean |
equals(java.lang.Object obj)
|
int |
getX()
Returns the x coordinate of the point. |
int |
getY()
Returns y-coordinate of the point. |
int |
hashCode()
|
java.lang.String |
toString()
|
Point |
translate(int dx,
int dy)
Returns translated point at location (x + dx, y + dy). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Point ZERO_POINT
Constructor Detail |
public Point()
public Point(int x, int y)
x
- the x coordinate of the pointy
- the y coordinate of the pointMethod Detail |
public int getX()
public int getY()
public double distance(int px, int py)
px
- the x coordinate of the specified pointpy
- the y coordinate of the specified point
public double distance(Point p)
p
- the specified point
public double distanceSq(int px, int py)
px
- the x coordinate of the specified pointpy
- the y coordinate of the specified point
public double distanceSq(Point p)
p
- the specified point
public Point translate(int dx, int dy)
dx
- the distance to move the point along the x axisdy
- the distance to move the point along the y axis
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |