1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.leave.accrual.bucket;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.kpme.core.accrualcategory.AccrualCategory;
22 import org.kuali.kpme.core.principal.PrincipalHRAttributes;
23 import org.kuali.kpme.tklm.api.leave.accrual.bucket.BasicLeaveBalanceContract;
24 import org.kuali.kpme.tklm.leave.accrual.bucket.exception.MaximumBalanceException;
25 import org.kuali.kpme.tklm.leave.accrual.bucket.exception.NegativeBalanceException;
26 import org.kuali.kpme.tklm.leave.accrual.bucket.exception.UsageLimitException;
27 import org.kuali.kpme.tklm.leave.block.LeaveBlock;
28
29 public class BasicLeaveBalance extends LeaveBalance implements BasicLeaveBalanceContract {
30
31 private List<LeaveBlock> leaveBlocks;
32
33 public BasicLeaveBalance(AccrualCategory accrualCategory, PrincipalHRAttributes principalCalendar) {
34 super(accrualCategory, principalCalendar);
35 leaveBlocks = new ArrayList<LeaveBlock>();
36 }
37
38 private final static String BALANCE_TYPE = "BASIC_BALANCE";
39
40 @Override
41 public void add(LeaveBlock leaveBlock) throws UsageLimitException,
42 MaximumBalanceException, NegativeBalanceException {
43 add(leaveBlock.getLeaveAmount());
44
45 leaveBlocks.add(leaveBlock);
46 }
47
48 @Override
49 public void remove(LeaveBlock leaveBlock) throws UsageLimitException,
50 MaximumBalanceException, NegativeBalanceException {
51 remove(leaveBlock.getLeaveAmount());
52
53 leaveBlocks.remove(leaveBlock);
54 }
55
56 @Override
57 public String getBalanceType() {
58 return BALANCE_TYPE;
59 }
60
61 @Override
62 public void adjust(LeaveBlock leaveBlock) throws UsageLimitException,
63 MaximumBalanceException, NegativeBalanceException {
64
65
66 }
67
68 @Override
69 public void clear() {
70 leaveBlocks.clear();
71 super.clear();
72 }
73
74 }