java.lang.Object | |||
↳ | org.joda.time.DateTimeField | ||
↳ | org.joda.time.field.BaseDateTimeField | ||
↳ | org.joda.time.field.DecoratedDateTimeField |
Known Direct Subclasses |
DecoratedDateTimeField
extends BaseDateTimeField
,
implementing only the minimum required set of methods. These implemented
methods delegate to a wrapped field.
This design allows new DateTimeField types to be defined that piggyback on top of another, inheriting all the safe method implementations from BaseDateTimeField. Should any method require pure delegation to the wrapped field, simply override and use the provided getWrappedField method.
DecoratedDateTimeField is thread-safe and immutable, and its subclasses must be as well.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the value of this field from the milliseconds.
| |||||||||||
Returns the duration per unit value of this field.
| |||||||||||
Get the maximum allowable value for this field.
| |||||||||||
Get the minimum allowable value for this field.
| |||||||||||
Returns the range duration of this field.
| |||||||||||
Gets the wrapped date time field.
| |||||||||||
Returns true if the set method is lenient.
| |||||||||||
Round to the lowest whole unit of this field.
| |||||||||||
Sets a value in the milliseconds supplied.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.joda.time.field.BaseDateTimeField
| |||||||||||
From class
org.joda.time.DateTimeField
| |||||||||||
From class
java.lang.Object
|
Constructor.
field | the field being decorated |
---|---|
type | allow type to be overridden |
Get the value of this field from the milliseconds.
instant | the milliseconds from 1970-01-01T00:00:00Z to query |
---|
Returns the duration per unit value of this field. For example, if this field represents "hour of day", then the unit duration is an hour.
Get the maximum allowable value for this field.
Get the minimum allowable value for this field.
Returns the range duration of this field. For example, if this field represents "hour of day", then the range duration is a day.
Gets the wrapped date time field.
Returns true if the set method is lenient. If so, it accepts values that are out of bounds. For example, a lenient day of month field accepts 32 for January, converting it to February 1.
Round to the lowest whole unit of this field. After rounding, the value of this field and all fields of a higher magnitude are retained. The fractional millis that cannot be expressed in whole increments of this field are set to minimum.
For example, a datetime of 2002-11-02T23:34:56.789, rounded to the lowest whole hour is 2002-11-02T23:00:00.000.
instant | the milliseconds from 1970-01-01T00:00:00Z to round |
---|
Sets a value in the milliseconds supplied.
The value of this field will be set. If the value is invalid, an exception if thrown.
If setting this field would make other fields invalid, then those fields may be changed. For example if the current date is the 31st January, and the month is set to February, the day would be invalid. Instead, the day would be changed to the closest value - the 28th/29th February as appropriate.
instant | the milliseconds from 1970-01-01T00:00:00Z to set in |
---|---|
value | the value to set, in the units of the field |