| org.joda.time.ReadWritablePeriod
All known Subclasses: org.joda.time.MutablePeriod,
ReadWritablePeriod | public interface ReadWritablePeriod extends ReadablePeriod(Code) | | 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.
author: Brian S O'Neill author: Stephen Colebourne since: 1.0 |
Method Summary | |
void | add(DurationFieldType field, int value) Adds to the value of one of the fields. | void | add(ReadablePeriod period) Adds a period to this one by adding each field in turn. | void | add(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis) Adds to each field of this period. | void | add(ReadableInterval interval) Adds an interval to this one by dividing the interval into
fields and then adding each field in turn. | void | addDays(int days) Adds the specified days to the number of days in the period. | void | addHours(int hours) Adds the specified hours to the number of hours in the period. | void | addMillis(int millis) Adds the specified millis to the number of millis in the period. | void | addMinutes(int minutes) Adds the specified minutes to the number of minutes in the period. | void | addMonths(int months) Adds the specified months to the number of months in the period. | void | addSeconds(int seconds) Adds the specified seconds to the number of seconds in the period. | void | addWeeks(int weeks) Adds the specified weeks to the number of weeks in the period. | void | addYears(int years) Adds the specified years to the number of years in the period. | void | clear() Clears the period, setting all values back to zero. | void | set(DurationFieldType field, int value) Sets the value of one of the fields. | void | setDays(int days) Sets the number of days of the period. | void | setHours(int hours) Sets the number of hours of the period. | void | setMillis(int millis) Sets the number of millis of the period. | void | setMinutes(int minutes) Sets the number of minutes of the period. | void | setMonths(int months) Sets the number of months of the period. | void | setPeriod(ReadablePeriod period) Sets all the fields in one go from another ReadablePeriod. | void | setPeriod(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis) Sets all the fields in one go. | void | setPeriod(ReadableInterval interval) Sets all the fields in one go from an interval dividing the
fields using the period type. | void | setSeconds(int seconds) Sets the number of seconds of the period. | void | setValue(int index, int value) Sets the value of one of the fields by index. | void | setWeeks(int weeks) Sets the number of weeks of the period. | void | setYears(int years) Sets the number of years of the period. |
add | void add(DurationFieldType field, int value)(Code) | | Adds to the value of one of the fields.
The field type specified must be one of those that is supported by the period.
Parameters: field - a DurationFieldType instance that is supported by this period Parameters: value - the value to add to the field throws: IllegalArgumentException - if the field is null or not supported |
add | void add(ReadablePeriod period)(Code) | | Adds a period to this one by adding each field in turn.
Parameters: period - the period to add, null means add nothing throws: IllegalArgumentException - if the period being added contains a fieldnot supported by this period throws: ArithmeticException - if the addition exceeds the capacity of the period |
add | void add(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis)(Code) | | Adds to each field of this period.
Parameters: years - amount of years to add to this period, which must be zero if unsupported Parameters: months - amount of months to add to this period, which must be zero if unsupported Parameters: weeks - amount of weeks to add to this period, which must be zero if unsupported Parameters: days - amount of days to add to this period, which must be zero if unsupported Parameters: hours - amount of hours to add to this period, which must be zero if unsupported Parameters: minutes - amount of minutes to add to this period, which must be zero if unsupported Parameters: seconds - amount of seconds to add to this period, which must be zero if unsupported Parameters: millis - amount of milliseconds to add to this period, which must be zero if unsupported throws: IllegalArgumentException - if the period being added contains a fieldnot supported by this period throws: ArithmeticException - if the addition exceeds the capacity of the period |
add | void add(ReadableInterval interval)(Code) | | Adds an interval to this one by dividing the interval into
fields and then adding each field in turn.
Parameters: interval - the interval to add, null means add nothing throws: ArithmeticException - if the addition exceeds the capacity of the period |
addDays | void addDays(int days)(Code) | | Adds the specified days to the number of days in the period.
Parameters: days - the number of days throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addHours | void addHours(int hours)(Code) | | Adds the specified hours to the number of hours in the period.
Parameters: hours - the number of hours throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addMillis | void addMillis(int millis)(Code) | | Adds the specified millis to the number of millis in the period.
Parameters: millis - the number of millis throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addMinutes | void addMinutes(int minutes)(Code) | | Adds the specified minutes to the number of minutes in the period.
Parameters: minutes - the number of minutes throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addMonths | void addMonths(int months)(Code) | | Adds the specified months to the number of months in the period.
Parameters: months - the number of months throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addSeconds | void addSeconds(int seconds)(Code) | | Adds the specified seconds to the number of seconds in the period.
Parameters: seconds - the number of seconds throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addWeeks | void addWeeks(int weeks)(Code) | | Adds the specified weeks to the number of weeks in the period.
Parameters: weeks - the number of weeks throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
addYears | void addYears(int years)(Code) | | Adds the specified years to the number of years in the period.
Parameters: years - the number of years throws: IllegalArgumentException - if field is not supported and the value is non-zero throws: ArithmeticException - if the addition exceeds the capacity of the period |
clear | void clear()(Code) | | Clears the period, setting all values back to zero.
|
set | void set(DurationFieldType field, int value)(Code) | | Sets the value of one of the fields.
The field type specified must be one of those that is supported by the period.
Parameters: field - a DurationFieldType instance that is supported by this period Parameters: value - the new value for the field throws: IllegalArgumentException - if the field is null or not supported |
setDays | void setDays(int days)(Code) | | Sets the number of days of the period.
Parameters: days - the number of days throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setHours | void setHours(int hours)(Code) | | Sets the number of hours of the period.
Parameters: hours - the number of hours throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setMillis | void setMillis(int millis)(Code) | | Sets the number of millis of the period.
Parameters: millis - the number of millis throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setMinutes | void setMinutes(int minutes)(Code) | | Sets the number of minutes of the period.
Parameters: minutes - the number of minutes throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setMonths | void setMonths(int months)(Code) | | Sets the number of months of the period.
Parameters: months - the number of months throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setPeriod | void setPeriod(ReadablePeriod period)(Code) | | Sets all the fields in one go from another ReadablePeriod.
Parameters: period - the period to set, null means zero length period throws: IllegalArgumentException - if an unsupported field's value is non-zero |
setPeriod | void setPeriod(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis)(Code) | | Sets all the fields in one go.
Parameters: years - amount of years in this period, which must be zero if unsupported Parameters: months - amount of months in this period, which must be zero if unsupported Parameters: weeks - amount of weeks in this period, which must be zero if unsupported Parameters: days - amount of days in this period, which must be zero if unsupported Parameters: hours - amount of hours in this period, which must be zero if unsupported Parameters: minutes - amount of minutes in this period, which must be zero if unsupported Parameters: seconds - amount of seconds in this period, which must be zero if unsupported Parameters: millis - amount of milliseconds in this period, which must be zero if unsupported throws: IllegalArgumentException - if an unsupported field's value is non-zero |
setPeriod | void setPeriod(ReadableInterval interval)(Code) | | Sets all the fields in one go from an interval dividing the
fields using the period type.
Parameters: interval - the interval to set, null means zero length |
setSeconds | void setSeconds(int seconds)(Code) | | Sets the number of seconds of the period.
Parameters: seconds - the number of seconds throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setValue | void setValue(int index, int value)(Code) | | Sets the value of one of the fields by index.
Parameters: index - the field index Parameters: value - the new value for the field throws: IndexOutOfBoundsException - if the index is invalid |
setWeeks | void setWeeks(int weeks)(Code) | | Sets the number of weeks of the period.
Parameters: weeks - the number of weeks throws: IllegalArgumentException - if field is not supported and the value is non-zero |
setYears | void setYears(int years)(Code) | | Sets the number of years of the period.
Parameters: years - the number of years throws: IllegalArgumentException - if field is not supported and the value is non-zero |
|
|