public class SimpleGranularityGridPolicy extends AbstractGridPolicy<SimpleGranularity>
SimpleGranularity
class to adjust start
and end times.Constructor and Description |
---|
SimpleGranularityGridPolicy()
Constructs a new policy that will support all granularities found in the
SimpleGranularity enumerator. |
SimpleGranularityGridPolicy(boolean adjustingStartTimes,
boolean adjustingEndTimes,
SimpleGranularity... granularities)
Constructs a new policy.
|
SimpleGranularityGridPolicy(SimpleGranularity... granularities)
Constructs a new policy, which will round start and end times.
|
Modifier and Type | Method and Description |
---|---|
long |
getGridAdjustedEndTime(SimpleGranularity sg,
long endTime,
IDatelineModel<SimpleGranularity> model,
boolean autoGrid)
Returns a grid adjusted time point for the given unadjusted end time.
|
long |
getGridAdjustedStartTime(SimpleGranularity sg,
long startTime,
IDatelineModel<SimpleGranularity> model,
boolean autoGrid)
Returns a grid adjusted time point for the given unadjusted start time.
|
ITimeSpan |
getGridAdjustedTimeSpan(SimpleGranularity sg,
ITimeSpan timeSpan,
IDatelineModel<SimpleGranularity> model,
boolean autoGrid)
Returns a grid adjusted time span for the given unadjusted time span.
|
getGridGranularities, isAdjustingEndTimes, isAdjustingStartTimes
assertClass
public SimpleGranularityGridPolicy(boolean adjustingStartTimes, boolean adjustingEndTimes, SimpleGranularity... 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 SimpleGranularityGridPolicy(SimpleGranularity... granularities)
granularities
- the supported grid granularitiespublic SimpleGranularityGridPolicy()
SimpleGranularity
enumerator.public ITimeSpan getGridAdjustedTimeSpan(SimpleGranularity sg, ITimeSpan timeSpan, IDatelineModel<SimpleGranularity> model, boolean autoGrid)
IGridPolicy
sg
- the granularity for which to return an adjusted time pointtimeSpan
- the original time span that needs adjustmentmodel
- 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(SimpleGranularity sg, long startTime, IDatelineModel<SimpleGranularity> model, boolean autoGrid)
IGridPolicy
sg
- the granularity for which to return an adjusted time pointstartTime
- the original time that needs adjustmentmodel
- 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(SimpleGranularity sg, long endTime, IDatelineModel<SimpleGranularity> model, boolean autoGrid)
IGridPolicy
sg
- the granularity for which to return an adjusted time pointendTime
- the original time that needs adjustmentmodel
- 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–2016 Dirk Lemmermann Software & Consulting. All rights reserved.