1 /** 2 * Copyright 2004-2014 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 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.kpme.tklm.api.leave.block; 17 18 import org.kuali.kpme.core.api.calendar.entry.CalendarEntry; 19 import org.kuali.kpme.tklm.api.leave.calendar.LeaveCalendarContract; 20 21 import java.util.List; 22 23 24 /** 25 * <p>LeaveBlockAggregateContract interface</p> 26 * 27 */ 28 public interface LeaveBlockAggregateContract { 29 30 /** 31 * The dayLeaveBlockListist that has been sorted by timestamp for the LeaveBlockAggregateContract 32 * 33 * <p> 34 * a sorted dayLeaveBlockList of a LeaveBlockAggregate 35 * <p> 36 * 37 * @return a sorted dayLeaveBlockList for LeaveBlockAggregate 38 */ 39 public List<? extends LeaveBlockContract> getFlattenedLeaveBlockList(); 40 41 /** 42 * Provides a way to access all of the leave blocks for a given week. 43 * 44 * <p> 45 * Outer list is 0 indexed list representing days in a week. 46 * Inner List are all of the time blocks for that day. 47 * 48 * Ex. 49 * 50 * List<List<LeaveBlock>> week0 = getWeekLeaveBlocks(0); 51 * List<LeaveBlock> day0 = week0.get(0); 52 * <p> 53 * 54 * @param week (integer) to retrieve the leave blocks for 55 * @return the total number of weeks for LeaveBlockAggregate 56 */ 57 public List<? extends List<? extends LeaveBlockContract>> getWeekLeaveBlocks(int week); 58 59 /** 60 * The total number of weeks that the LeaveBlockAggregate represents 61 * 62 * <p> 63 * the total number of weeks of a LeaveBlockAggregate 64 * <p> 65 * 66 * @return the total number of weeks 67 */ 68 public int numberOfAggregatedWeeks(); 69 70 /** 71 * The dayLeaveBlockList associated with the LeaveBlockAggregate 72 * 73 * <p> 74 * dayLeaveBlockList of a LeaveBlockAggregate 75 * <p> 76 * 77 * @return dayLeaveBlockList for LeaveBlockAggregate 78 */ 79 public List<? extends List <? extends LeaveBlockContract>> getDayLeaveBlockList(); 80 81 /** 82 * The CalendarEntry object associated with the LeaveBlockAggregate 83 * 84 * <p> 85 * leaveCalendarEntry of a LeaveBlockAggregate 86 * <p> 87 * 88 * @return leaveCalendarEntry for LeaveBlockAggregate 89 */ 90 public CalendarEntry getleaveCalendarEntry(); 91 92 /** 93 * The LeaveCalendar object associated with the LeaveBlockAggregate 94 * 95 * <p> 96 * leaveCalendar of a LeaveBlockAggregate 97 * <p> 98 * 99 * @return leaveCalendar for LeaveBlockAggregate 100 */ 101 public LeaveCalendarContract getLeaveCalendar(); 102 103 }