Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cse1102.geometry;
- public class Vertex
- {
- private int x;
- private int y;
- public Vertex()
- {
- this.x = 0;
- this.y = 0;
- }
- public Vertex(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
- public int getX()
- {
- return x;
- }
- public void setX(int x)
- {
- this.x = x;
- }
- public int getY()
- {
- return y;
- }
- public void setY(int y)
- {
- this.y = y;
- }
- public void deltaMove(int deltaX, int deltaY)
- {
- this.x = this.x + deltaX;
- this.y = this.y + deltaY;
- }
- public String toString()
- {
- String message = "Type : Vertex" + "\n" +
- "X Coordinate : " + this.x + "\n" +
- "Y Coordinate : " + this.y + "\n" ;
- return message;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement