-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.java
More file actions
94 lines (86 loc) · 3.41 KB
/
Copy pathData.java
File metadata and controls
94 lines (86 loc) · 3.41 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
import java.util.*;
import java.lang.Math;
import java.time.LocalDate;
import java.io.*;
public class Data {
public static ArrayList<String> generaldata = new ArrayList<String>();
public static ArrayList<String> customerdata = new ArrayList<String>();
public static ArrayList<String> investordata = new ArrayList<String>();
public static ArrayList<String> ATMarray = new ArrayList<String>(); //atm info
public static String typeOfAccount = ""; //updates the type of account the user is current in
public static String method = ""; //gets updated when ever a method calls a common class
public static Boolean testingmode = false;
public static void generalarray(String info, int infotype) throws IOException{
generaldata.clear();
File file = new File("GeneralData.csv"); //describing the file
FileWriter fw = new FileWriter(file , true);
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line = "";
while((line = br.readLine()) != null){
String [] values = line.split(",");
if(values[infotype].equals(info)){
for(String value: values){
generaldata.add(value);
}
}
}
br.close();
fw.close();
}
public static void customerarray(String info, int infotype) throws IOException{
customerdata.clear();
File file = new File("CustomerData.csv"); //describing the file
FileWriter fw = new FileWriter(file , true);
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line = "";
while((line = br.readLine()) != null){
String [] values = line.split(",");
if(values[infotype].equals(info)){
for(String value: values){
customerdata.add(value);
}
}
}
br.close();
fw.close();
}
public static void investorarray(String info, int infotype) throws IOException{
investordata.clear();
File file = new File("InvestorsData.csv"); //describing the file
FileWriter fw = new FileWriter(file , true);
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line = "";
while((line = br.readLine()) != null){
String [] values = line.split(",");
if(values[infotype].equals(info)){
for(String value: values){
investordata.add(value);
}
}
}
br.close();
fw.close();
}
public static void card(String info, int infotype) throws IOException{
ATMarray.clear();
File file = new File("Card.csv"); //describing the file
FileWriter fw = new FileWriter(file , true);
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line = "";
while((line = br.readLine()) != null){
String [] values = line.split(",");
if(values[infotype].equals(info)){
for(String value: values){
ATMarray.add(value);
}
}
}
fr.close();
br.close();
fw.close();
}
}