-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCell.java
More file actions
206 lines (183 loc) · 5.27 KB
/
Cell.java
File metadata and controls
206 lines (183 loc) · 5.27 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/***************************************************************************************
*
* NAME: Alyssa Higuchi
*
* HOMEWORK: 6
*
* CLASS: ICS 211
*
* INSTRUCTOR: Scott Robertson
*
* DATE: February 25, 2016
*
* FILE: Cell.java
*
* DESCRIPTION: This file contains the Cell class for homework 6. You can think of a
* Cell in the same way that you think of a node.
*
***************************************************************************************/
public class Cell {
private Cell north;
private Cell east;
private Cell south;
private Cell west;
private String data;
/********************************************************************
*
* Method: Cell
*
* Description: Constructor for the Cell class
*
* @param None
*
* @return None
*
********************************************************************/
public Cell() {
north = null;
east = null;
south = null;
west = null;
data = null;
}
/********************************************************************************
*
* Method: setNorth
*
* Description: Sets the north value of the current cell to a given cell
*
* @param cell The Cell which will be directly north of the current cell
*
* @return None
*
********************************************************************************/
public void setNorth(Cell cell) {
this.north = cell;
}
/********************************************************************************
*
* Method: setEast
*
* Description: Sets the east value of the current cell to a given cell
*
* @param cell The Cell which will be directly east of the current cell
*
* @return None
*
********************************************************************************/
public void setEast(Cell cell) {
this.east = cell;
}
/********************************************************************************
*
* Method: setSouth
*
* Description: Sets the south value of the current cell to a given cell
*
* @param cell The Cell which will be directly south of the current cell
*
* @return None
*
********************************************************************************/
public void setSouth(Cell cell) {
this.south = cell;
}
/********************************************************************************
*
* Method: setWest
*
* Description: Sets the west value of the current cell to a given cell
*
* @param cell The Cell which will be directly west of the current cell
*
* @return None
*
********************************************************************************/
public void setWest(Cell cell) {
this.west = cell;
}
/********************************************************************************
*
* Method: setData
*
* Description: Sets the data of the current cell to the given data
*
* @param newData The data which the cell should contain
*
* @return None
*
********************************************************************************/
public void setData(String newData) {
this.data = newData;
}
/********************************************************************************
*
* Method: getNorth
*
* Description: Returns the cell directly north of the given cell
*
* @param None
*
* @return The cell directly north of the current cell
*
********************************************************************************/
public Cell getNorth() {
return this.north;
}
/********************************************************************************
*
* Method: getEast
*
* Description: Returns the cell directly east of the given cell
*
* @param None
*
* @return The cell directly east of the current cell
*
********************************************************************************/
public Cell getEast() {
return this.east;
}
/********************************************************************************
*
* Method: getSouth
*
* Description: Returns the cell directly south of the given cell
*
* @param None
*
* @return The cell directly south of the current cell
*
********************************************************************************/
public Cell getSouth() {
return this.south;
}
/********************************************************************************
*
* Method: getWest
*
* Description: Returns the cell directly west of the given cell
*
* @param None
*
* @return The cell directly west of the current cell
*
********************************************************************************/
public Cell getWest() {
return this.west;
}
/********************************************************************************
*
* Method: getData
*
* Description: Returns the data contained in the current cell
*
* @param None
*
* @return The data contained in the current cell
*
********************************************************************************/
public String getData() {
return this.data;
}
}