Class TimeIntervalNamer

Object
TimeIntervalNamer

public class TimeIntervalNamer extends Object
Derives a human-friendly name for a time-interval.
Author:
Owen Feehan
  • Constructor Details

    • TimeIntervalNamer

      public TimeIntervalNamer(ZoneOffset offset)
      Creates a new TimeIntervalNamer 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 and ignoreTime are bothSet, the date is included nevertheless, so the name is not empty.

      Parameters:
      start - minimum date-time in range
      end - maximum date-time in range
      dateStyle - how to style the date in the name.
      timeStyle - how to style the time in the name.
      Returns:
      the name.