-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMemory.java
More file actions
58 lines (46 loc) · 1.13 KB
/
MainMemory.java
File metadata and controls
58 lines (46 loc) · 1.13 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
package Simulation;
import java.util.ArrayList;
class Hole{
private int startAddress;
private int endAddress;
private int size;
public Hole(int startAddress, int endAddress) {
this.startAddress = startAddress;
this.endAddress = endAddress;
this.size = endAddress - startAddress;
}
public int getStartAddress() {
return startAddress;
}
public void setStartAddress(int startAddress) {
this.startAddress = startAddress;
}
public int getEndAddress() {
return endAddress;
}
public void setEndAddress(int endAddress) {
this.endAddress = endAddress;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
}
public class MainMemory {
public ArrayList<Hole> holeArrayList = new ArrayList<>();
int mainSquareX, mainSquareY;
int mainSquareW, mainSquareH;
Process[] array = new Process[100];
public MainMemory() {
mainSquareX = 40;
mainSquareY = 40;
mainSquareW = 60;
mainSquareH = 220;
holeArrayList.add(new Hole(40, 260));
}
public ArrayList<Hole> getHoleArrayList(){
return holeArrayList;
}
}