Class CalendarPeriod.Factory<T>

java.lang.Object
net.time4j.range.CalendarPeriod.Parser<T>
net.time4j.range.CalendarPeriod.Factory<T>
Type Parameters:
T - generic type of timepoints on the underlying timeline
Enclosing class:
CalendarPeriod<T>

public static class CalendarPeriod.Factory<T> extends CalendarPeriod.Parser<T>

Serves for the creation of generic calendar intervals on a timeline.

  • Method Details

    • between

      public CalendarPeriod<T> between(T start, T end)

      Creates a closed interval between given calendrical timepoints.

      Parameters:
      start - the start of interval
      end - the end of interval (inclusive)
      Returns:
      new calendrical interval
    • parse

      public CalendarPeriod<T> parse(CharSequence text, ChronoParser<T> parser, String intervalPattern) throws ParseException
      Description copied from class: CalendarPeriod.Parser

      Interpretes given text as interval using given interval pattern.

      It is also possible to use an or-pattern logic. Example see DateInterval.parse(String, ChronoParser, String).

      Overrides:
      parse in class CalendarPeriod.Parser<T>
      Parameters:
      text - text to be parsed
      parser - format object for parsing start and end components
      intervalPattern - interval pattern containing placeholders {0} and {1} (for start and end)
      Returns:
      parsed interval (closed if calendrical else half-open)
      Throws:
      ParseException - if the text is not parseable