public class Point
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private double |
x
A double value representing the x coordinate of the point
|
private double |
y
A double value representing the y coordinate of the point
|
| Constructor and Description |
|---|
Point(double x,
double y)
A constructor for the Point class
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object)
Method to compare 'this' Point for equality with the 'object'
specified as a parameter.
|
double |
getX()
Getter for the x coordinate of the point
|
double |
getY()
Getter for the y coordinate of the point
|
void |
setX(double x)
Setter to change the x coordinate of the point
|
void |
setY(double y)
Setter to change the y coordinate of the point
|
java.lang.String |
toString()
Method to render 'this' instance of the Point class into a String.
|
private double x
private double y
public Point(double x,
double y)
x - A double value representing the x coordinate of the pointy - A double value representing the y coordinate of the pointpublic double getX()
public void setX(double x)
x - A double value representing the new x coordinate of the pointpublic double getY()
public void setY(double y)
y - A double value representing the new y coordinate of the pointpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - An Object to be tested for equality with 'this' linepublic java.lang.String toString()
toString in class java.lang.Object