-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathState.java
More file actions
62 lines (46 loc) · 938 Bytes
/
State.java
File metadata and controls
62 lines (46 loc) · 938 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
/**
* @author Drew Scott
*
* Contains state class
*/
import java.util.ArrayList;
public class State {
private String name;
private int area;
private ArrayList<State> neighbors;
private int id;
public State(String name) {
this.name = name;
this.neighbors = new ArrayList<State>();
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return this.id;
}
public String getName() {
return this.name;
}
public void setArea(int area) {
this.area = area;
}
public int getArea() {
return this.area;
}
public void removeNeighbor(State state) {
this.neighbors.remove(state);
}
public ArrayList<State> getNeighbors() {
return this.neighbors;
}
public void addNeighbor(State state) {
this.neighbors.add(state);
}
public void setNeighbors(ArrayList<State> newNeighbors) {
this.neighbors = newNeighbors;
}
public String toString() {
return this.name;
}
}