An immutable period consisting of the ISO-8601 years, months, days, hours, minutes, seconds and milliseconds, such as '3 Months, 4 Days and 7 Hours'.
A period is a human-scale description of an amount of time.
Attributes | |
dateOnly | Source Code shared actual ReadableDatePeriod dateOnly Returns a date only view of this period. Refined declaration: dateOnly |
days | Source Code shared actual Integer days The number of days. Refined declaration: days |
hash | Source Code shared actual Integer hash This implementation respect the constraint that if Refined declaration: hash |
hours | Source Code shared actual Integer hours The number of hours. Refined declaration: hours |
milliseconds | Source Code shared actual Integer milliseconds The number of milliseconds. Refined declaration: milliseconds |
minutes | Source Code shared actual Integer minutes The number of minutes. Refined declaration: minutes |
months | Source Code shared actual Integer months The number of months. Refined declaration: months |
seconds | Source Code shared actual Integer seconds The number of seconds. Refined declaration: seconds |
string | Source Code shared actual String string Returns the ISO-8601 formatted string for this period. Refined declaration: string |
timeOnly | Source Code shared actual ReadableTimePeriod timeOnly Returns a time only view of this period. Refined declaration: timeOnly |
years | Source Code shared actual Integer years The number of years. Refined declaration: years |
Inherited Attributes |
Attributes inherited from: ReadableDatePeriod |
Attributes inherited from: ReadablePeriod |
Attributes inherited from: ReadableTimePeriod |
Methods | |
compare | Source Code Return the result of comparing this period to the other period. Refined declaration: compare |
equals | Source Code shared actual Boolean equals(Object that) Checks if this period is equal to another period. Refined declaration: equals |
isZero | Source Code shared Boolean isZero() Checks if this period is zero-length. |
minusDays | Source Code Returns a copy of this period with the specified number of days subtracted. Refined declaration: minusDays |
minusHours | Source Code Returns a copy of this period with the specified number of hours subtracted. Refined declaration: minusHours |
minusMilliseconds | Source Code Returns a copy of this period with the specified number of milliseconds subtracted. Refined declaration: minusMilliseconds |
minusMinutes | Source Code Returns a copy of this period with the specified number of minutes subtracted. Refined declaration: minusMinutes |
minusMonths | Source Code Returns a copy of this period with the specified number of months subtracted. Refined declaration: minusMonths |
minusSeconds | Source Code Returns a copy of this period with the specified number of seconds subtracted. Refined declaration: minusSeconds |
minusYears | Source Code Returns a copy of this period with the specified number of years subtracted. Refined declaration: minusYears |
normalized | Source Code shared actual Period normalized() Returns a copy of this period with all amounts normalized to the standard ranges for date/time fields. Two normalizations occur, one for years and months, and one for hours, minutes, seconds and milliseconds. Days are not normalized, as a day may vary in length at daylight savings cutover. Neither is days normalized into months, as number of days per month varies from month to another and depending on the leap year. Refined declaration: normalized |
plus | Source Code Returns a new period that is a sum of the two periods. Refined declaration: plus |
plusDays | Source Code Returns a copy of this period with the specified number of days added. Refined declaration: plusDays |
plusHours | Source Code Returns a copy of this period with the specified number of hours added. Refined declaration: plusHours |
plusMilliseconds | Source Code Returns a copy of this period with the specified number of milliseconds added. Refined declaration: plusMilliseconds |
plusMinutes | Source Code Returns a copy of this period with the specified number of minutes added. Refined declaration: plusMinutes |
plusMonths | Source Code Returns a copy of this period with the specified number of months added. Refined declaration: plusMonths |
plusSeconds | Source Code Returns a copy of this period with the specified number of seconds added. Refined declaration: plusSeconds |
plusYears | Source Code Returns a copy of this period with the specified number of years added. Refined declaration: plusYears |
scale | Source Code Each field will be scalable independently, and the result will not be normalized Refined declaration: scale |
withDays | Source Code Returns a copy of this period with the specified amount of days. Refined declaration: withDays |
withHours | Source Code Returns a copy of this period with the specified amount of hours. Refined declaration: withHours |
withMilliseconds | Source Code Returns a copy of this period with the specified amount of milliseconds. Refined declaration: withMilliseconds |
withMinutes | Source Code Returns a copy of this period with the specified amount of minutes. Refined declaration: withMinutes |
withMonths | Source Code Returns a copy of this period with the specified amount of months. Refined declaration: withMonths |
withSeconds | Source Code Returns a copy of this period with the specified amount of seconds. Refined declaration: withSeconds |
withYears | Source Code Returns a copy of this period with the specified amount of years. Refined declaration: withYears |
Inherited Methods |
Methods inherited from: Comparable<Other> compare |
Methods inherited from: PeriodBehavior<Self> |
Methods inherited from: Scalable<Scale,Value> scale |
Methods inherited from: Summable<Other> plus |