|
@@ -2,18 +2,48 @@ package rocks.zipcode.quiz5.collections;
|
2
|
2
|
|
3
|
3
|
import rocks.zipcode.quiz5.objectorientation.account.BankAccount;
|
4
|
4
|
|
|
5
|
+import java.util.ArrayList;
|
|
6
|
+import java.util.List;
|
|
7
|
+
|
5
|
8
|
/**
|
6
|
9
|
* @author leon on 27/12/2018.
|
7
|
10
|
*/
|
8
|
11
|
public class Bank {
|
|
12
|
+ private Integer indexNumber;
|
|
13
|
+ private List<BankAccount> bankAccounts;
|
|
14
|
+
|
|
15
|
+ public Bank() { this.bankAccounts = new ArrayList<>();
|
|
16
|
+ }
|
|
17
|
+
|
9
|
18
|
public BankAccount removeBankAccountByIndex(Integer indexNumber) {
|
|
19
|
+ bankAccounts.remove(indexNumber);
|
|
20
|
+
|
10
|
21
|
return null;
|
11
|
22
|
}
|
12
|
23
|
|
13
|
24
|
public void addBankAccount(BankAccount bankAccount) {
|
|
25
|
+ bankAccounts.add(bankAccount);
|
|
26
|
+
|
|
27
|
+
|
14
|
28
|
}
|
15
|
29
|
|
16
|
30
|
public Boolean containsBankAccount(BankAccount bankAccount) {
|
17
|
|
- throw new UnsupportedOperationException("Method not yet implemented");
|
|
31
|
+
|
|
32
|
+ return bankAccounts.contains(bankAccount);
|
18
|
33
|
}
|
|
34
|
+
|
|
35
|
+ public Integer getIndexNumber() {
|
|
36
|
+ return indexNumber;
|
|
37
|
+ }
|
|
38
|
+
|
|
39
|
+ public void setIndexNumber(Integer indexNumber) {
|
|
40
|
+ this.indexNumber = indexNumber;
|
|
41
|
+ }
|
|
42
|
+
|
|
43
|
+ public BankAccount getBankAccount(Integer indexNumber) {
|
|
44
|
+
|
|
45
|
+ return bankAccounts.get(indexNumber);
|
|
46
|
+ }
|
|
47
|
+
|
|
48
|
+
|
19
|
49
|
}
|