java.lang.Object | ||||
↳ | org.joda.time.DateTimeField | |||
↳ | org.joda.time.field.BaseDateTimeField | |||
↳ | org.joda.time.field.DecoratedDateTimeField | |||
↳ | org.joda.time.field.OffsetDateTimeField |
Generic offset adjusting datetime field.
OffsetDateTimeField is thread-safe and immutable.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
| |||||||||||
Constructor.
| |||||||||||
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add the specified amount of offset units to the specified time
instant.
| |||||||||||
Add the specified amount of offset units to the specified time
instant.
| |||||||||||
Add to the offset component of the specified time instant,
wrapping around within that component if necessary.
| |||||||||||
Get the amount of offset units from the specified time instant.
| |||||||||||
Gets the amount by which this field is 'leap' for the specified instant.
| |||||||||||
If this field were to leap, then it would be in units described by the
returned duration.
| |||||||||||
Get the maximum value for the field.
| |||||||||||
Get the minimum value for the field.
| |||||||||||
Returns the offset added to the field values.
| |||||||||||
Returns whether this field is 'leap' for the specified instant.
| |||||||||||
Returns the fractional duration milliseconds of this field.
| |||||||||||
Round to the highest whole unit of this field.
| |||||||||||
Round to the lowest whole unit of this field.
| |||||||||||
Round to the nearest whole unit of this field.
| |||||||||||
Round to the nearest whole unit of this field.
| |||||||||||
Round to the nearest whole unit of this field.
| |||||||||||
Set the specified amount of offset units to the specified time instant.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.joda.time.field.DecoratedDateTimeField
| |||||||||||
From class
org.joda.time.field.BaseDateTimeField
| |||||||||||
From class
org.joda.time.DateTimeField
| |||||||||||
From class
java.lang.Object
|
Constructor.
field | the field to wrap, like "year()". |
---|---|
offset | offset to add to field values |
IllegalArgumentException | if offset is zero |
---|
Constructor.
field | the field to wrap, like "year()". |
---|---|
type | the field type this field actually uses |
offset | offset to add to field values |
IllegalArgumentException | if offset is zero |
---|
Constructor.
field | the field to wrap, like "year()". |
---|---|
type | the field type this field actually uses |
offset | offset to add to field values |
minValue | minimum allowed value |
maxValue | maximum allowed value |
IllegalArgumentException | if offset is zero |
---|
Add the specified amount of offset units to the specified time instant. The amount added may be negative.
instant | the time instant in millis to update. |
---|---|
amount | the amount of units to add (can be negative). |
Add the specified amount of offset units to the specified time instant. The amount added may be negative.
instant | the time instant in millis to update. |
---|---|
amount | the amount of units to add (can be negative). |
Add to the offset component of the specified time instant, wrapping around within that component if necessary.
instant | the time instant in millis to update. |
---|---|
amount | the amount of units to add (can be negative). |
Get the amount of offset units from the specified time instant.
instant | the time instant in millis to query. |
---|
Gets the amount by which this field is 'leap' for the specified instant.
For example, a leap year would return one, a non leap year would return zero.
This implementation returns zero.
instant | the instant to check for leap status |
---|
If this field were to leap, then it would be in units described by the returned duration. If this field doesn't ever leap, null is returned.
This implementation returns null.
Get the maximum value for the field.
Get the minimum value for the field.
Returns the offset added to the field values.
Returns whether this field is 'leap' for the specified instant.
For example, a leap year would return true, a non leap year would return false.
This implementation returns false.
instant | the instant to check for leap status |
---|
Returns the fractional duration milliseconds of this field. In other words, calling remainder returns the duration that roundFloor would subtract.
For example, on a datetime of 2002-11-02T23:34:56.789, the remainder by hour is 34 minutes and 56.789 seconds.
The default implementation computes
instant - roundFloor(instant)
. Subclasses are encouraged to
provide a more efficient implementation.
instant | the milliseconds from 1970-01-01T00:00:00Z to get the remainder |
---|
Round to the highest whole unit of this field. The value of this field and all fields of a higher magnitude may be incremented in order to achieve this result. 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 highest whole hour is 2002-11-03T00:00:00.000.
The default implementation calls roundFloor, and if the instant is modified as a result, adds one field unit. Subclasses are encouraged to provide a more efficient implementation.
instant | the milliseconds from 1970-01-01T00:00:00Z to round |
---|
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 |
---|
Round to the nearest whole unit of this field. If the given millisecond value is closer to the floor, this function behaves like roundFloor. If the millisecond value is closer to the ceiling or is exactly halfway, this function behaves like roundCeiling.
instant | the milliseconds from 1970-01-01T00:00:00Z to round |
---|
Round to the nearest whole unit of this field. If the given millisecond value is closer to the floor, this function behaves like roundFloor. If the millisecond value is closer to the ceiling, this function behaves like roundCeiling.
If the millisecond value is exactly halfway between the floor and ceiling, the ceiling is chosen over the floor only if it makes this field's value even.
instant | the milliseconds from 1970-01-01T00:00:00Z to round |
---|
Round to the nearest whole unit of this field. If the given millisecond value is closer to the floor or is exactly halfway, this function behaves like roundFloor. If the millisecond value is closer to the ceiling, this function behaves like roundCeiling.
instant | the milliseconds from 1970-01-01T00:00:00Z to round |
---|
Set the specified amount of offset units to the specified time instant.
instant | the time instant in millis to update. |
---|---|
value | value of units to set. |
IllegalArgumentException | if value is too large or too small. |
---|