Class TimeIntervalNamer
Object
TimeIntervalNamer
Derives a human-friendly name for a time-interval.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionTimeIntervalNamer
(ZoneOffset offset) Creates a newTimeIntervalNamer
instance. -
Method Summary
Modifier and TypeMethodDescriptionnameFor
(LocalDateTime start, LocalDateTime end, DateStyle dateStyle, TimeStyle timeStyle) Derives a name from the time-range in the cluster and some parameters.
-
Constructor Details
-
TimeIntervalNamer
Creates a newTimeIntervalNamer
instance.- Parameters:
offset
- The offset to assume the time-stamp belongs in.
-
-
Method Details
-
nameFor
public String nameFor(LocalDateTime start, LocalDateTime end, DateStyle dateStyle, TimeStyle timeStyle) Derives a name from the time-range in the cluster and some parameters.If
ignoreDate
andignoreTime
are bothSet, the date is included nevertheless, so the name is not empty.- Parameters:
start
- minimum date-time in rangeend
- maximum date-time in rangedateStyle
- how to style the date in the name.timeStyle
- how to style the time in the name.- Returns:
- the name.
-