-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProviderFiles.java
More file actions
53 lines (46 loc) · 1.7 KB
/
ProviderFiles.java
File metadata and controls
53 lines (46 loc) · 1.7 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
package src;
import java.util.HashMap;
/**
* The ProviderFiles class. This creates and stores a hash map to store all members and their data.
*
* @author Eleri Floyd
* @version 1.0
*/
public class ProviderFiles {
//public static int consultations; //counts number of consultations
public static HashMap<Integer, Provider> providerMap = new HashMap<> (); //stores all providers and their information
/**
* Inserts provider and their corresponding information into has map to be stored
* @param name the provider's name
* @param accNumber the provider's account numer
* @param address the provider's address
* @param city the provider's city
* @param state the provider's state
* @param zip the provider's zip code
*/
public static void insertProvider(String name, int accNumber, String address, String city, String state, int zip) {
//fee currently initalized to 0
Provider newProvider = new Provider(name, accNumber, address, city, state, zip, 0);
providerMap.put(newProvider.accNumber, newProvider);
}
/**
* Searches for a provider by their given account number
* @param accNumber the provider's account number
* @return the provider found at the given member number
*/
public static Provider searchProvider(int accNumber) {
if (providerMap.containsKey(accNumber)) {
return providerMap.get(accNumber);
}
else {
return null;
}
}
/**
* Removes provider with the given account number
* @param accNumber the provider's account number
*/
public static void removeProvider(int accNumber) {
providerMap.remove(accNumber);
}
}