Package net.time4j.range
Class Weeks
- All Implemented Interfaces:
Serializable
,Comparable<Weeks>
,TimeSpan<CalendarUnit>
Represents a time span in 7-day weeks.
- 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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Weeks
between(CalendarWeek w1, CalendarWeek w2)
Determines the difference in weeks between given quarter years.static <T extends TimePoint<? super CalendarUnit, T>>
Weeksbetween(T t1, T t2)
Determines the temporal distance between given dates/time-points in weeks.static Weeks
of(int weeks)
Obtains a time span in given weeks.static Weeks
parsePeriod(String period)
Parses the canonical ISO-8601-format "PnW" 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 weeks.
-
ONE
Constant for exactly one week.
-
-
Method Details
-
of
Obtains a time span in given weeks.
- Parameters:
weeks
- count of weeks, maybe negative- Returns:
- time span in weeks
- See Also:
CalendarUnit.WEEKS
-
between
Determines the temporal distance between given dates/time-points in weeks.
- Type Parameters:
T
- generic type of time-points- Parameters:
t1
- first time-pointt2
- second time-point- Returns:
- result of week difference
- See Also:
PlainDate
,PlainTimestamp
-
between
Determines the difference in weeks between given quarter years.
- Parameters:
w1
- first calendar weekw2
- second calendar week- Returns:
- difference in weeks
-
parsePeriod
Parses the canonical ISO-8601-format "PnW" with possible preceding minus-char.
- Parameters:
period
- the formatted string to be parsed- Returns:
- parsed instance
- Throws:
ParseException
- if given argument cannot be parsed
-