Package net.time4j.range
Class Quarters
- All Implemented Interfaces:
Serializable,Comparable<Quarters>,TimeSpan<CalendarUnit>
Represents a time span in gregorian quarter years.
- Since:
- 3.21/4.17
- Author:
- Meno Hochschild
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.time4j.engine.TimeSpan
TimeSpan.Item<U> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Quartersbetween(CalendarQuarter q1, CalendarQuarter q2)Determines the difference in quarters between given quarter years.static <T extends TimePoint<? super CalendarUnit, T>>
Quartersbetween(T t1, T t2)Determines the temporal distance between given dates/time-points in gregorian quarter years.static Quartersof(int quarters)Obtains a time span in given gregorian quarter years.static QuartersparsePeriod(String period)Parses the canonical format "PnQ" with possible preceding minus-char.Methods inherited from class net.time4j.range.SingleUnitTimeSpan
abs, addTo, compareTo, contains, equals, getAmount, getPartialAmount, getTotalLength, getUnit, hashCode, inverse, isEmpty, isNegative, isPositive, minus, minus, multipliedBy, plus, plus, subtractFrom, toStdDuration, toString, toString
-
Field Details
-
ZERO
Constant for zero gregorian quarter years.
-
ONE
Constant for exactly one gregorian quarter year.
-
-
Method Details
-
of
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
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-pointt2- second time-point- Returns:
- result of difference in quarter years
- See Also:
PlainDate,PlainTimestamp
-
between
Determines the difference in quarters between given quarter years.
- Parameters:
q1- first quarter yearq2- second quarter year- Returns:
- difference in quarter years
-
parsePeriod
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
-