-
Notifications
You must be signed in to change notification settings - Fork 0
/
JobListing.java
59 lines (56 loc) · 1.6 KB
/
JobListing.java
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
/**
* @author Anton, Christian, Kylie, Jack
*/
import java.util.ArrayList;
/**
* Creating a JobListings ArrayList or type Job
*/
public class JobListing {
private static JobListing joblistings = null;
private static ArrayList<Job> jobList = new ArrayList<>();
private JobListing() {
jobList = DataLoader.getJobListings();
}
/**
* Checking if jobListing already exists and if not creating a new instance of a
* JobListing
*/
public static JobListing getInstance() {
if (joblistings == null) {
joblistings = new JobListing();
}
return joblistings;
}
public static ArrayList<Job> getJob() {
return jobList;
}
/**
* Adding a job with specific paramifications to the list of Jobs
* @param location
* @param pay
* @param remote
* @param date
* @param description
* @param skills
*/
public static void addJob(String location, Double pay, Boolean remote, String date, String description, ArrayList<String> skills) {
jobList.add(new Job(location, pay, remote, date, description, skills));
}
/**
* Writing data to datawriter and logging out
*/
public void logout() {
DataWriter.saveJobListing();
}
public void getApplicants() {
}
/**
* As we Did in DataLoaderTest we print out all jobListings in the JSON when this method is called
*/
public void showListings() {
ArrayList<Job> jobs = DataLoader.getJobListings();
for(Job job : jobs) {
System.out.println(job);
}
}
}