public final class Weeks extends SingleUnitTimeSpan<CalendarUnit,Weeks>
Represents a time span in 7-day weeks.
TimeSpan.Item<U>| Modifier and Type | Field and Description |
|---|---|
static Weeks |
ONE
Constant for exactly one week.
|
static Weeks |
ZERO
Constant for zero weeks.
|
| Modifier and Type | Method and Description |
|---|---|
static Weeks |
between(CalendarWeek w1,
CalendarWeek w2)
Determines the difference in weeks between given quarter years.
|
static <T extends TimePoint<? super CalendarUnit,T>> |
between(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.
|
abs, addTo, compareTo, contains, equals, getAmount, getPartialAmount, getTotalLength, getUnit, hashCode, inverse, isEmpty, isNegative, isPositive, minus, minus, multipliedBy, plus, plus, subtractFrom, toStdDuration, toStringpublic static final Weeks ZERO
Constant for zero weeks.
public static final Weeks ONE
Constant for exactly one week.
public static Weeks of(int weeks)
Obtains a time span in given weeks.
weeks - count of weeks, maybe negativeCalendarUnit.WEEKSpublic static <T extends TimePoint<? super CalendarUnit,T>> Weeks between(T t1, T t2)
Determines the temporal distance between given dates/time-points in weeks.
T - generic type of time-pointst1 - first time-pointt2 - second time-pointPlainDate,
PlainTimestamppublic static Weeks between(CalendarWeek w1, CalendarWeek w2)
Determines the difference in weeks between given quarter years.
w1 - first calendar weekw2 - second calendar weekpublic static Weeks parsePeriod(String period) throws ParseException
Parses the canonical ISO-8601-format "PnW" with possible preceding minus-char.
period - the formatted string to be parsedParseException - if given argument cannot be parsedCopyright © 2014–2018. All rights reserved.