public final class Weekcycle extends BasicUnit implements IsoDateUnit, Serializable
Represents a special unit for week-based years which are described by ISO-8601 and follow the week cycle from Monday to Sunday.
| Modifier and Type | Field and Description |
|---|---|
static Weekcycle |
YEARS
Constant for week-based years which either have 364 or 371 days.
|
| Modifier and Type | Method and Description |
|---|---|
long |
between(PlainDate start,
PlainDate end)
Calculates the temporal distance between given calendar dates
in this calendar unit.
|
double |
getLength()
Defines the typical length of this time unit in seconds without
taking into account anomalies like timezone effects or leap seconds.
|
char |
getSymbol()
Gets the format symbol which is used to display this time unit
in canonical representations of timespans.
|
boolean |
isCalendrical()
Queries if this time unit is calendrical respective is at least
as long as a calendar day.
|
String |
toString() |
public static final Weekcycle YEARS
Constant for week-based years which either have 364 or 371 days.
public long between(PlainDate start, PlainDate end)
Calculates the temporal distance between given calendar dates in this calendar unit.
start - starting dateend - ending datepublic char getSymbol()
IsoUnitGets the format symbol which is used to display this time unit in canonical representations of timespans.
Canonical timespan formats follow ISO-8601. For example, the day unit is represented by the symbol D. Note that the letters P and T must not be used because these special characters are for structuring, the display. In ISO-8601 following symbols are defined:
If this method yields as special case a digit 1-9 then Time4J expects
a fractional display of preceding second unit S that is nanoseconds,
microseconds and milliseconds. Time4J will use the comma as decimal
separation char in the canonical display as recommended by ISO-8601
unless the system property "net.time4j.format.iso.decimal.dot"
is set to true (which causes the usage of a dot).
getSymbol in interface IsoUnitDuration.toString()public double getLength()
ChronoUnitDefines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.
Important note: This method can only yield an estimated value and is not intended to assist in calculations of durations, but only in sorting of units.
getLength in interface ChronoUnitpublic boolean isCalendrical()
ChronoUnitQueries if this time unit is calendrical respective is at least as long as a calendar day.
Implementation note: The method must be consistent with the typical
length of the unit. The expression
Double.compare(unit.getLength(), 86400.0) >= 0 is
equivalent to unit.isCalendrical().
isCalendrical in interface ChronoUnittrue if at least as long as a day else falseCopyright © 2014–2017. All rights reserved.