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.joda.time.LocalDate;
22 import org.kuali.kpme.core.accrualcategory.AccrualCategory;
23 import org.kuali.kpme.core.principal.PrincipalHRAttributes;
24 import org.kuali.kpme.tklm.api.leave.accrual.bucket.FmlaLeaveBalanceContract;
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 import org.kuali.kpme.tklm.leave.block.LeaveBlock;
29
30 public class FmlaLeaveBalance extends LeaveBalance implements FmlaLeaveBalanceContract {
31
32 private List<LeaveBlock> leaveBlocks;
33
34 public FmlaLeaveBalance(AccrualCategory accrualCategory, PrincipalHRAttributes principalCalendar) {
35 super(accrualCategory, principalCalendar);
36 asOfDate = LocalDate.now();
37 leaveBlocks = new ArrayList<LeaveBlock>();
38 }
39
40 private final static String BALANCE_TYPE = "FMLA_BALANCE";
41
42 @Override
43 public void add(LeaveBlock leaveBlock) throws UsageLimitException,
44 MaximumBalanceException, NegativeBalanceException {
45
46 add(leaveBlock.getLeaveAmount());
47
48 leaveBlocks.add(leaveBlock);
49 }
50
51 @Override
52 public void remove(LeaveBlock leaveBlock) throws UsageLimitException,
53 MaximumBalanceException, NegativeBalanceException {
54 remove(leaveBlock.getLeaveAmount());
55
56 leaveBlocks.remove(leaveBlock);
57 }
58
59 @Override
60 public String getBalanceType() {
61 return BALANCE_TYPE;
62 }
63
64 @Override
65 public void adjust(LeaveBlock leaveBlock) throws UsageLimitException,
66 MaximumBalanceException, NegativeBalanceException {
67
68
69 }
70
71 @Override
72 public void clear() {
73 leaveBlocks.clear();
74 super.clear();
75 }
76
77 }