Class Quarters

All Implemented Interfaces:
Serializable, Comparable<Quarters>, TimeSpan<CalendarUnit>

public final class Quarters extends SingleUnitTimeSpan<CalendarUnit,​Quarters>

Represents a time span in gregorian quarter years.

Since:
3.21/4.17
Author:
Meno Hochschild
See Also:
Serialized Form
  • Field Details

    • ZERO

      public static final Quarters ZERO

      Constant for zero gregorian quarter years.

    • ONE

      public static final Quarters ONE

      Constant for exactly one gregorian quarter year.

  • Method Details

    • of

      public static Quarters of(int quarters)

      Obtains a time span in given gregorian quarter years.

      Parameters:
      quarters - count of gregorian quarter years, maybe negative
      Returns:
      time span in quarter years
      See Also:
      CalendarUnit.QUARTERS
    • between

      public static <T extends TimePoint<? super CalendarUnit,​ T>> Quarters between(T t1, T t2)

      Determines the temporal distance between given dates/time-points in gregorian quarter years.

      Type Parameters:
      T - generic type of time-points
      Parameters:
      t1 - first time-point
      t2 - second time-point
      Returns:
      result of difference in quarter years
      See Also:
      PlainDate, PlainTimestamp
    • between

      public static Quarters between(CalendarQuarter q1, CalendarQuarter q2)

      Determines the difference in quarters between given quarter years.

      Parameters:
      q1 - first quarter year
      q2 - second quarter year
      Returns:
      difference in quarter years
    • parsePeriod

      public static Quarters parsePeriod(String period) throws ParseException

      Parses the canonical format "PnQ" with possible preceding minus-char.

      Parameters:
      period - the formatted string to be parsed
      Returns:
      parsed instance
      Throws:
      ParseException - if given argument cannot be parsed