|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcynosurex.graphics2D.Point2D
public class Point2D
A point represented in 2D coordination space, e.g. (x, y).
Field Summary | |
---|---|
double |
x
The x coordinate. |
double |
y
The y coordinate. |
Fields inherited from interface cynosurex.internal.CommonInterface |
---|
copyright, copyrightYears, notice, program, version |
Fields inherited from interface cynosurex.internal.AuthorCommon |
---|
author, copyrightSymbol, noticeMsg, rights |
Fields inherited from interface cynosurex.internal.CompanyCommon |
---|
company, email, website |
Constructor Summary | |
---|---|
Point2D()
Constructs and initializes a Point initialized with (0, 0, 0). |
|
Point2D(double x,
double y)
Constructs and initializes a Point from the specified x, y, and z coordinates. |
|
Point2D(Point2D p)
Constructs and initializes a Point with the same location as the specified Point2D. |
Method Summary | |
---|---|
double |
distance(Point2D p)
Calculates the distance between this Point2D and the specified Point2D. |
boolean |
equals(java.lang.Object obj)
Checks whether two pointers are equal. |
Point2D |
getLocation()
|
int |
hashCode()
Returns the hashcode for this Point2D. |
void |
move(double x,
double y)
Changes the point to have the specified location. |
void |
setLocation(double x,
double y)
Changes the point to have the specificed location. |
void |
setLocation(Point2D p)
Changes the point to have the specificed location. |
java.lang.String |
toString()
Returns the String representation of this Point's coordinates. |
void |
translate(int x,
int y)
Translates the 2D point. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double x
public double y
Constructor Detail |
---|
public Point2D()
public Point2D(Point2D p)
p
- a point in 2D spacepublic Point2D(double x, double y)
x
- the x coordinatey
- the y coordinateMethod Detail |
---|
public double distance(Point2D p)
p
- the specified Point2Dpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Point2D getLocation()
public int hashCode()
hashCode
in class java.lang.Object
public void move(double x, double y)
x
- the x coordinate of the new locationy
- the y coordinate of the new locationpublic void setLocation(Point2D p)
p
- the Point2D containing the new locationpublic void setLocation(double x, double y)
x
- the x coordinate of the new locationy
- the y coordinate of the new locationpublic java.lang.String toString()
toString
in class java.lang.Object
public void translate(int x, int y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |