-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.java
More file actions
41 lines (41 loc) · 866 Bytes
/
Point.java
File metadata and controls
41 lines (41 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
*This class represents a point in a 2D array of ints
*using an x and y value.
*@author Michael Roscoe
**/
public class Point {
/**
*The x value representing the point's horizontal position
*going from left to right.
**/
private final int x;
/**
*The y value representing the vertical position of the point
*going from top to bottom.
**/
private final int y;
/**
*Constructor for a Point, takes in the x and y values and creates
*the point
*@param xIn The x value of the point
*@param yIn The y value of the point
**/
public Point (int xIn, int yIn) {
x = xIn;
y = yIn;
}
/**
*Method to access the x value of the point
*@return The x value of the point
**/
public int getX () {
return x;
}
/**
*Method to access the y value of the point
*@return The y value of the point
**/
public int getY () {
return y;
}
}