-
Notifications
You must be signed in to change notification settings - Fork 1
/
Directory.java
46 lines (39 loc) · 1.1 KB
/
Directory.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
import java.util.ArrayList;
import java.util.List;
/**
* This class is for storing a list of partners, and a list countries.
* This class contains setter and getter method for partners,
* getter and addCountry method for countries.
* The addCountry method adds a Country object to the countries list.
* @Author Tim Zhang
*/
public class Directory {
private List<Partner> partners = new ArrayList<>();
private List<Country> countries = new ArrayList<>();
public Directory() {
}
/**
*
* @return a list of partners
*/
public List<Partner> getPartners() {
return partners;
}
/**
* set this.partners references to parameter partners.
* @param partners
*/
public void setPartners(List<Partner> partners) {
this.partners = partners;
}
/**
* Add a country object to countries
* @param country
*/
public void addCountry(Country country){countries.add(country);}
public List<Country> getCountries() { return countries; }
@Override
public String toString() {
return "partners=" + partners;
}
}