| org.joda.time.field.BaseDurationField org.joda.time.field.PreciseDurationField
PreciseDurationField | public class PreciseDurationField extends BaseDurationField (Code) | | Duration field class representing a field with a fixed unit length.
PreciseDurationField is thread-safe and immutable.
author: Stephen Colebourne author: Brian S O'Neill since: 1.0 |
Method Summary | |
public long | add(long instant, int value) | public long | add(long instant, long value) | public boolean | equals(Object obj) Compares this duration field to another. | public long | getDifferenceAsLong(long minuendInstant, long subtrahendInstant) | public long | getMillis(int value, long instant) Get the millisecond duration of this field from its value. | public long | getMillis(long value, long instant) Get the millisecond duration of this field from its value. | final public long | getUnitMillis() Returns the amount of milliseconds per unit value of this field. | public long | getValueAsLong(long duration, long instant) Get the value of this field from the milliseconds. | public int | hashCode() Gets a hash code for this instance. | final public boolean | isPrecise() This field is precise. |
PreciseDurationField | public PreciseDurationField(DurationFieldType type, long unitMillis)(Code) | | Constructor.
Parameters: type - the field type Parameters: unitMillis - the unit milliseconds |
add | public long add(long instant, int value)(Code) | | |
add | public long add(long instant, long value)(Code) | | |
equals | public boolean equals(Object obj)(Code) | | Compares this duration field to another.
Two fields are equal if of the same type and duration.
Parameters: obj - the object to compare to if equal |
getDifferenceAsLong | public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)(Code) | | |
getMillis | public long getMillis(int value, long instant)(Code) | | Get the millisecond duration of this field from its value.
Parameters: value - the value of the field, which may be negative Parameters: instant - ignored the milliseconds that the field represents, which may benegative |
getMillis | public long getMillis(long value, long instant)(Code) | | Get the millisecond duration of this field from its value.
Parameters: value - the value of the field, which may be negative Parameters: instant - ignored the milliseconds that the field represents, which may benegative |
getUnitMillis | final public long getUnitMillis()(Code) | | Returns the amount of milliseconds per unit value of this field.
the unit size of this field, in milliseconds |
getValueAsLong | public long getValueAsLong(long duration, long instant)(Code) | | Get the value of this field from the milliseconds.
Parameters: duration - the milliseconds to query, which may be negative Parameters: instant - ignored the value of the field, in the units of the field, which may benegative |
hashCode | public int hashCode()(Code) | | Gets a hash code for this instance.
a suitable hashcode |
isPrecise | final public boolean isPrecise()(Code) | | This field is precise.
true always |
|
|