public class TimeGranularityGridPolicy extends AbstractGridPolicy<TimeGranularity>
TimeGranularity class to adjust start and
end times.| Constructor and Description |
|---|
TimeGranularityGridPolicy()
Constructs a new policy that will support the following granularities:
TimeGranularity.MONTH_SHORT
TimeGranularity.WEEK
TimeGranularity.DAY_SHORT
TimeGranularity.HOUR
TimeGranularity.MINUTE
TimeGranularity.SECOND
The policy will round start and end times. |
TimeGranularityGridPolicy(boolean adjustingStartTimes,
boolean adjustingEndTimes,
TimeGranularity... granularities)
Constructs a new policy.
|
TimeGranularityGridPolicy(TimeGranularity... granularities)
Constructs a new policy, which will round start and end times.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getGridAdjustedEndTime(TimeGranularity tg,
long endTime,
IDatelineModel<TimeGranularity> datelineModel,
boolean autoGrid)
Returns a grid adjusted time point for the given unadjusted end time.
|
long |
getGridAdjustedStartTime(TimeGranularity tg,
long startTime,
IDatelineModel<TimeGranularity> datelineModel,
boolean autoGrid)
Returns a grid adjusted time point for the given unadjusted start time.
|
ITimeSpan |
getGridAdjustedTimeSpan(TimeGranularity tg,
ITimeSpan timeSpan,
IDatelineModel<TimeGranularity> datelineModel,
boolean autoGrid)
Returns a grid adjusted time span for the given unadjusted time span.
|
getGridGranularities, isAdjustingEndTimes, isAdjustingStartTimesassertClasspublic TimeGranularityGridPolicy(boolean adjustingStartTimes,
boolean adjustingEndTimes,
TimeGranularity... granularities)
adjustingStartTimes - if TRUE the start times will be rounded based on the given
grid granularityadjustingEndTimes - if TRUE the end times will be rounded based on the given grid
granularitygranularities - the supported grid granularitiespublic TimeGranularityGridPolicy(TimeGranularity... granularities)
granularities - the supported grid granularitiespublic TimeGranularityGridPolicy()
AbstractGridPolicy.getGridGranularities()public ITimeSpan getGridAdjustedTimeSpan(TimeGranularity tg, ITimeSpan timeSpan, IDatelineModel<TimeGranularity> datelineModel, boolean autoGrid)
IGridPolicytg - the granularity for which to return an adjusted time pointtimeSpan - the original time span that needs adjustmentdatelineModel - the model used by the dateline (needed for the auto grid
feature)autoGrid - if TRUE the grid calculations will be based on the minor
granularity shown by the datelinepublic long getGridAdjustedStartTime(TimeGranularity tg, long startTime, IDatelineModel<TimeGranularity> datelineModel, boolean autoGrid)
IGridPolicytg - the granularity for which to return an adjusted time pointstartTime - the original time that needs adjustmentdatelineModel - the model used by the dateline (needed for the auto grid
feature)autoGrid - if TRUE the grid calculations will be based on the minor
granularity shown by the datelinepublic long getGridAdjustedEndTime(TimeGranularity tg, long endTime, IDatelineModel<TimeGranularity> datelineModel, boolean autoGrid)
IGridPolicytg - the granularity for which to return an adjusted time pointendTime - the original time that needs adjustmentdatelineModel - the model used by the dateline (needed for the auto grid
feature)autoGrid - if TRUE the grid calculations will be based on the minor
granularity shown by the datelineCopyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.