Class CalendarDailyBucketService
java.lang.Object
overit.geocallapp.wfm.roughplanning.bl.bucket.BucketService
overit.geocallapp.wfm.roughplanning.bl.bucket.CalendarBucketService
overit.geocallapp.wfm.roughplanning.bl.bucket.CalendarDailyBucketService
The CalendarDailyBucketService is the implementation of
CalendarBucketService
using a calendar day duration as a time unit.
Starting from starDate param, it generates a bucket that begins on the same date
and is large a number of calendar days specified in the timeSize property (mind that, the end of the bucket must be less or equal than the endDate param).
At the end the total number of buckets created is totalBuckets = calendarDaysBetweenParamDates / timeSize
Example:
startDate = 15/01/2024
endDate = 21/01/2024
calendarDaysBetweenParamDates = 7
timeSize = 2
totalBuckets = 7 / 2 = 3 buckets
(bucket1 from 15/01/2024 to 16/01/2024)
(bucket2 from 17/01/2024 to 18/01/2024)
(bucket10 from 19/01/2024 to 20/01/2024)- Since:
- 19.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCalendarDailyBucketService(Long roughPlanning, TimeUnit timeUnit, Long timeSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanBucketBeCreated(Date startBucketDate, Date endDate) It establishes whether a bucket can be createdprotected DategetEndBucketDate(Date startBucketDate) Returns an end date for the bucket creationprotected DategetInitialStartBucketDate(Date startDate) Returns an initial date for the bucket creationMethods inherited from class overit.geocallapp.wfm.roughplanning.bl.bucket.CalendarBucketService
createBucketsMethods inherited from class overit.geocallapp.wfm.roughplanning.bl.bucket.BucketService
getRoughPlanning, getTimeSize, getTimeUnit
-
Constructor Details
-
CalendarDailyBucketService
-
-
Method Details
-
canBucketBeCreated
Description copied from class:CalendarBucketServiceIt establishes whether a bucket can be created- Specified by:
canBucketBeCreatedin classCalendarBucketService- Parameters:
startBucketDate- starting bucket dateendDate- upper limit end date to establish that a bucket can be created- Returns:
- a boolean
-
getEndBucketDate
Description copied from class:CalendarBucketServiceReturns an end date for the bucket creation- Specified by:
getEndBucketDatein classCalendarBucketService- Parameters:
startBucketDate- starting bucket date- Returns:
- a date
-
getInitialStartBucketDate
Description copied from class:CalendarBucketServiceReturns an initial date for the bucket creation- Specified by:
getInitialStartBucketDatein classCalendarBucketService- Parameters:
startDate- the lower limit for buckets creation- Returns:
- a date
-