-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCell.java
More file actions
67 lines (60 loc) · 984 Bytes
/
Cell.java
File metadata and controls
67 lines (60 loc) · 984 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package maze;
/**
* The Cell class keeps the location and set and get the next Cell
*
* @author Nhat Nguyen
* @author Jasmine Mai
*/
public class Cell {
private Cell node;
private int x;
private int y;
/**
* Constructor has the location of each Cell
*
* @param x The x-coordinate
* @param y The y-coordinate
*/
public Cell(int x, int y) {
this.x = x;
this.y = y;
}
/**
* Gets the x-coordinate
*
* @return x The x-coordinate
*/
public int getx() {
return x;
}
/**
* Gets the y-coordinate
*
* @return y The y-coordinate
*/
public int gety() {
return y;
}
/**
* Gets the next node
*
* @return node The next node
*/
public Cell getNext() {
return node;
}
/**
* Sets the next node
*
* @param node The next node being set
*/
public void setNext(Cell node) {
this.node = node;
}
/**
* String Representation of the Cell class
*/
public String toString() {
return "[" + x + ":" + y + "]";
}
}