org.joda.time.ReadWritablePeriod |
Known Indirect Subclasses |
Defines a duration of time that can be queried and modified using datetime fields.
The implementation of this interface will be mutable. It may provide more advanced methods than those in the interface.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds to each field of this period.
| |||||||||||
Adds a period to this one by adding each field in turn.
| |||||||||||
Adds an interval to this one by dividing the interval into
fields and then adding each field in turn.
| |||||||||||
Adds to the value of one of the fields.
| |||||||||||
Adds the specified days to the number of days in the period.
| |||||||||||
Adds the specified hours to the number of hours in the period.
| |||||||||||
Adds the specified millis to the number of millis in the period.
| |||||||||||
Adds the specified minutes to the number of minutes in the period.
| |||||||||||
Adds the specified months to the number of months in the period.
| |||||||||||
Adds the specified seconds to the number of seconds in the period.
| |||||||||||
Adds the specified weeks to the number of weeks in the period.
| |||||||||||
Adds the specified years to the number of years in the period.
| |||||||||||
Clears the period, setting all values back to zero.
| |||||||||||
Sets the value of one of the fields.
| |||||||||||
Sets the number of days of the period.
| |||||||||||
Sets the number of hours of the period.
| |||||||||||
Sets the number of millis of the period.
| |||||||||||
Sets the number of minutes of the period.
| |||||||||||
Sets the number of months of the period.
| |||||||||||
Sets all the fields in one go from another ReadablePeriod.
| |||||||||||
Sets all the fields in one go from an interval dividing the
fields using the period type.
| |||||||||||
Sets all the fields in one go.
| |||||||||||
Sets the number of seconds of the period.
| |||||||||||
Sets the value of one of the fields by index.
| |||||||||||
Sets the number of weeks of the period.
| |||||||||||
Sets the number of years of the period.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.joda.time.ReadablePeriod
|
Adds to each field of this period.
years | amount of years to add to this period, which must be zero if unsupported |
---|---|
months | amount of months to add to this period, which must be zero if unsupported |
weeks | amount of weeks to add to this period, which must be zero if unsupported |
days | amount of days to add to this period, which must be zero if unsupported |
hours | amount of hours to add to this period, which must be zero if unsupported |
minutes | amount of minutes to add to this period, which must be zero if unsupported |
seconds | amount of seconds to add to this period, which must be zero if unsupported |
millis | amount of milliseconds to add to this period, which must be zero if unsupported |
IllegalArgumentException | if the period being added contains a field not supported by this period |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds a period to this one by adding each field in turn.
period | the period to add, null means add nothing |
---|
IllegalArgumentException | if the period being added contains a field not supported by this period |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds an interval to this one by dividing the interval into fields and then adding each field in turn.
interval | the interval to add, null means add nothing |
---|
ArithmeticException | if the addition exceeds the capacity of the period |
---|
Adds to the value of one of the fields.
The field type specified must be one of those that is supported by the period.
field | a DurationFieldType instance that is supported by this period |
---|---|
value | the value to add to the field |
IllegalArgumentException | if the field is null or not supported |
---|
Adds the specified days to the number of days in the period.
days | the number of days |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified hours to the number of hours in the period.
hours | the number of hours |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified millis to the number of millis in the period.
millis | the number of millis |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified minutes to the number of minutes in the period.
minutes | the number of minutes |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified months to the number of months in the period.
months | the number of months |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified seconds to the number of seconds in the period.
seconds | the number of seconds |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified weeks to the number of weeks in the period.
weeks | the number of weeks |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Adds the specified years to the number of years in the period.
years | the number of years |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|---|
ArithmeticException | if the addition exceeds the capacity of the period |
Clears the period, setting all values back to zero.
Sets the value of one of the fields.
The field type specified must be one of those that is supported by the period.
field | a DurationFieldType instance that is supported by this period |
---|---|
value | the new value for the field |
IllegalArgumentException | if the field is null or not supported |
---|
Sets the number of days of the period.
days | the number of days |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets the number of hours of the period.
hours | the number of hours |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets the number of millis of the period.
millis | the number of millis |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets the number of minutes of the period.
minutes | the number of minutes |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets the number of months of the period.
months | the number of months |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets all the fields in one go from another ReadablePeriod.
period | the period to set, null means zero length period |
---|
IllegalArgumentException | if an unsupported field's value is non-zero |
---|
Sets all the fields in one go from an interval dividing the fields using the period type.
interval | the interval to set, null means zero length |
---|
Sets all the fields in one go.
years | amount of years in this period, which must be zero if unsupported |
---|---|
months | amount of months in this period, which must be zero if unsupported |
weeks | amount of weeks in this period, which must be zero if unsupported |
days | amount of days in this period, which must be zero if unsupported |
hours | amount of hours in this period, which must be zero if unsupported |
minutes | amount of minutes in this period, which must be zero if unsupported |
seconds | amount of seconds in this period, which must be zero if unsupported |
millis | amount of milliseconds in this period, which must be zero if unsupported |
IllegalArgumentException | if an unsupported field's value is non-zero |
---|
Sets the number of seconds of the period.
seconds | the number of seconds |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets the value of one of the fields by index.
index | the field index |
---|---|
value | the new value for the field |
IndexOutOfBoundsException | if the index is invalid |
---|
Sets the number of weeks of the period.
weeks | the number of weeks |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|
Sets the number of years of the period.
years | the number of years |
---|
IllegalArgumentException | if field is not supported and the value is non-zero |
---|