public final class ChronoUnitGrid extends VirtualGrid<ChronoUnit>
ChronoUnit.| Constructor and Description |
|---|
ChronoUnitGrid(String name,
ChronoUnit unit,
int amount) |
| Modifier and Type | Method and Description |
|---|---|
Instant |
adjustTime(Instant instant,
ZoneId zoneId,
boolean roundUp,
DayOfWeek firstDayOfWeek)
Adjusts the given instant so that the returned instant will snap to the
position defined by the grid settings.
|
LocalTime |
adjustTime(LocalTime time,
boolean roundUp)
Adjusts the given local time so that the returned time will snap to the
position defined by the grid settings.
|
getAmount, getName, getShortName, getUnit, toStringpublic ChronoUnitGrid(String name, ChronoUnit unit, int amount)
public Instant adjustTime(Instant instant, ZoneId zoneId, boolean roundUp, DayOfWeek firstDayOfWeek)
VirtualGridadjustTime in class VirtualGrid<ChronoUnit>instant - the time to adjust to a grid locationzoneId - the time zone for which the adjustment is performed (can be
different from row to row)roundUp - a flag signaling whether we want the adjusted time to snap to
an earlier or later time (start time or end time)firstDayOfWeek - the weekday that is considered to be the first day of the week
(mostly Monday or Sunday)public LocalTime adjustTime(LocalTime time, boolean roundUp)
VirtualGridadjustTime in class VirtualGrid<ChronoUnit>time - the time to adjust to a grid locationroundUp - a flag signaling whether we want the adjusted time to snap to
an earlier or later time (start time or end time)Copyright © 2014 Dirk Lemmermann Software & Consulting. All rights reserved.