-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlogistics.java~
More file actions
81 lines (58 loc) · 1.37 KB
/
Copy pathlogistics.java~
File metadata and controls
81 lines (58 loc) · 1.37 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
import java.util.*;
public class logistics {
List<String> storeditems = new ArrayList<String> (100);
ArrayList<supervisor> spr = new ArrayList<supervisor>();
private String username;
private String department;
private int num;
public logistics()
{
}
public String logisticsAvb()
{
return "logistics";
}
public void storeInventory()
{
FileReader inp = new FileReader("db4logistic.csv");
BufferedReader bfile = new BufferedReader(inp);
String line= bfile.readLine();
int l=0;
while(line!= null)
{
List<String> items = Arrays.asList(line.split("\\s*,\\s*"));
spr[l].getName = items.get(0);
spr[l].getDepartment = items.get(1);
spr[l].num = Integer.parseInt(items.get(2));
for(int j=0;j<num;j++)
{
spr[l].storeditems.add(items.get(3+j));
}
line= bfile.readLine();
l++;
}
}
public void updateInventory(ArrayList<supervisor> spr,int size)
{
FileWriter file = new FileWriter("db4logistic.csv",false);
BufferedWriter bw = new BufferedWriter(file);
PrintWriter pw = new PrintWriter(bw);
for(int i=0;i<size;i++)
{
pw.print(a.get(i).getName +",");
pw.print(a.get(i).getDepartment +",");
pw.print(num[i]);
for(int j=0;j<num[i];j++)
{
pw.print(a.storeditems.get(j)+",")
}
}
pw.print(personarray[i].status);
if(i!= size-1)
{
pw.print("\n");
}
}
pw.close();
}
}