01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.kra.budget.service;
17:
18: import java.util.List;
19:
20: import org.kuali.module.kra.budget.bo.BudgetPeriod;
21:
22: /**
23: * This interface defines methods that a BudgetPeriod service must provide
24: */
25: public interface BudgetPeriodService {
26:
27: public BudgetPeriod getBudgetPeriod(String documentNumber,
28: Integer budgetPeriodSequenceNumber);
29:
30: public BudgetPeriod getFirstBudgetPeriod(String documentNumber);
31:
32: /**
33: * Returns the index (zero based) of a BudgetPeriod per the passed in budgetPeriodSequenceNumber.
34: *
35: * @param budgetPeriodSequenceNumber BudgetPeriod to find the index for.
36: * @param budgetPeriodList Budget.periods list
37: * @return index (zero based). -1 if it isn't found.
38: */
39: public int getPeriodIndex(Integer budgetPeriodSequenceNumber,
40: List budgetPeriodList);
41:
42: /**
43: * Finds the range between two BudgetPeriods.
44: *
45: * @param budgetPeriodSequenceNumberA First BudgetPeriod to find the range for.
46: * @param budgetPeriodSequenceNumberB Second BudgetPeriod to find the range for.
47: * @param budgetPeriodList Budget.periods list
48: * @return range. -1 if it isn't found.
49: */
50: public int getPeriodsRange(Integer budgetPeriodSequenceNumberA,
51: Integer budgetPeriodSequenceNumberB, List budgetPeriodList);
52:
53: /**
54: * Finds a BudgetPeriod with an offset to the budgetPeriodSequenceNumber's BudgetPeriod.
55: *
56: * @param budgetPeriodSequenceNumber BudgetPeriod to find the index for.
57: * @param offset may be positive or negative
58: * @param budgetPeriodList Budget.periods list
59: * @return in relation to budgetPeriodSequenceNumber's BudgetPeriod with offset
60: */
61: public BudgetPeriod getPeriodAfterOffset(
62: Integer budgetPeriodSequenceNumber, int offset,
63: List budgetPeriodList);
64: }
|