(x,y) coordinate space,
specified in integer precision.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.1 for interoperability. |
| public int | x
The X coordinate of this |
| public int | y
The Y coordinate of this |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Point(int
the X coordinate of the newly constructed x, int Pointthe Y coordinate of the newly constructed y)PointConstructs and initializes a point at the specified
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the object to be compared is
an instance of Point2D and has
the same values; false otherwise.an object to be compared with this obj)Point2DOverrides java. Determines whether or not two points are equal. |
| public Point | |
| public double | getX()
Implements abstract java. Returns the X coordinate of this |
| public double | getY()
Implements abstract java. Returns the Y coordinate of this |
| public void | move(int
the X coordinate of the new location x, int the Y coordinate of the new location y)Moves this point to the specified location in the
|
| public void | setLocation(Point
a point, the new location for this point p)Sets the location of the point to the specified location. |
| public void | setLocation(int
the X coordinate of the new location x, int the Y coordinate of the new location y)Changes the point to have the specified location. |
| public void | setLocation(double
the X coordinate of the new location x, double the Y coordinate of the new location y)Implements abstract java. Sets the location of this point to the specified double coordinates. |
| public String | Returns: a string representation of this pointOverrides java. Returns a string representation of this point and its location
in the |
| public void | translate(int
the distance to move this point
along the X axis dx, int the distance to move this point
along the Y axis dy)Translates this point, at location |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.1 for interoperability. | |
| x | back to summary |
|---|---|
| public int x The X coordinate of this
| |
| y | back to summary |
|---|---|
| public int y The Y coordinate of this
| |
| Point | back to summary |
|---|---|
| public Point() Constructs and initializes a point at the origin (0, 0) of the coordinate space.
| |
| Point | back to summary |
|---|---|
| public Point(Point p) Constructs and initializes a point with the same location as
the specified
| |
| Point | back to summary |
|---|---|
| public Point(int x, int y) Constructs and initializes a point at the specified
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines whether or not two points are equal. Two instances of
| |
| getLocation | back to summary |
|---|---|
| public Point getLocation() Returns the location of this point.
This method is included for completeness, to parallel the
| |
| getX | back to summary |
|---|---|
| public double getX() Implements abstract java. Doc from java. Returns the X coordinate of this
| |
| getY | back to summary |
|---|---|
| public double getY() Implements abstract java. Doc from java. Returns the Y coordinate of this
| |
| move | back to summary |
|---|---|
| public void move(int x, int y) Moves this point to the specified location in the
| |
| setLocation | back to summary |
|---|---|
| public void setLocation(Point p) Sets the location of the point to the specified location.
This method is included for completeness, to parallel the
| |
| setLocation | back to summary |
|---|---|
| public void setLocation(int x, int y) Changes the point to have the specified location.
This method is included for completeness, to parallel the
| |
| setLocation | back to summary |
|---|---|
| public void setLocation(double x, double y) Implements abstract java. Sets the location of this point to the specified double coordinates.
The double values will be rounded to integer values.
Any number smaller than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this point and its location
in the
| |
| translate | back to summary |
|---|---|
| public void translate(int dx, int dy) Translates this point, at location
| |