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.api.accrualcategory.AccrualCategory;
22 import org.kuali.kpme.core.principal.PrincipalHRAttributesBo;
23 import org.kuali.kpme.tklm.api.leave.accrual.bucket.BasicLeaveBalanceContract;
24 import org.kuali.kpme.tklm.api.leave.block.LeaveBlock;
25 import org.kuali.kpme.tklm.leave.accrual.bucket.exception.MaximumBalanceException;
26 import org.kuali.kpme.tklm.leave.accrual.bucket.exception.NegativeBalanceException;
27 import org.kuali.kpme.tklm.leave.accrual.bucket.exception.UsageLimitException;
28
29 public class BasicLeaveBalance extends LeaveBalance implements BasicLeaveBalanceContract {
30
31 private List<LeaveBlock> leaveBlocks;
32
33 public BasicLeaveBalance(AccrualCategory accrualCategory, PrincipalHRAttributesBo 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 }