-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNil.java
More file actions
43 lines (36 loc) · 895 Bytes
/
Nil.java
File metadata and controls
43 lines (36 loc) · 895 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
package ca.bcit.comp2526.a2a;
import java.awt.Color;
import javax.swing.JLabel;
/**
* Specific entity describing an empty cell.
* Created for the purpose of easier
* debugging for NullPointerExceptions.
* @author kekcoke
* @version 2.0.
*
*/
public class Nil extends Entity {
/**
* Generated sVUID.
*/
private static final long serialVersionUID = -4081784389887561779L;
private Cell cell;
/**
* Creates a NIL object,
* exclusively for an Empty cell.
* @param cell
* cell.
*/
public Nil(Cell cell) {
super(cell, EntityID.NIL, Color.GRAY, new JLabel("N"));
this.cell = cell;
init();
}
/**
* Sets green background.
*/
public void init() {
cell.add(new JLabel("n"));
cell.setBackground(Color.GRAY);
}
}