| java.lang.Object org.joda.time.DurationField org.joda.time.field.BaseDurationField
All known Subclasses: org.joda.time.field.PreciseDurationField, org.joda.time.field.DecoratedDurationField,
BaseDurationField | abstract public class BaseDurationField extends DurationField implements Serializable(Code) | | BaseDurationField provides the common behaviour for DurationField
implementations.
This class should generally not be used directly by API users. The
DurationField class should be used when different kinds of DurationField
objects are to be referenced.
BaseDurationField is thread-safe and immutable, and its subclasses must
be as well.
author: Brian S O'Neill See Also: DecoratedDurationField since: 1.0 |
Method Summary | |
public int | compareTo(Object durationField) | public int | getDifference(long minuendInstant, long subtrahendInstant) | public long | getMillis(int value) Get the millisecond duration of this field from its value, which is
approximate if this field is imprecise. | public long | getMillis(long value) Get the millisecond duration of this field from its value, which is
approximate if this field is imprecise. | final public String | getName() | final public DurationFieldType | getType() | public int | getValue(long duration) Get the value of this field from the milliseconds, which is approximate
if this field is imprecise. | public int | getValue(long duration, long instant) Get the value of this field from the milliseconds relative to an
instant.
If the milliseconds is positive, then the instant is treated as a
"start instant". | public long | getValueAsLong(long duration) Get the value of this field from the milliseconds, which is approximate
if this field is imprecise. | final public boolean | isSupported() | public String | toString() Get a suitable debug string. |
getDifference | public int getDifference(long minuendInstant, long subtrahendInstant)(Code) | | |
getMillis | public long getMillis(int value)(Code) | | Get the millisecond duration of this field from its value, which is
approximate if this field is imprecise.
Parameters: value - the value of the field, which may be negative the milliseconds that the field represents, which may benegative |
getMillis | public long getMillis(long value)(Code) | | Get the millisecond duration of this field from its value, which is
approximate if this field is imprecise.
Parameters: value - the value of the field, which may be negative the milliseconds that the field represents, which may benegative |
getValue | public int getValue(long duration)(Code) | | Get the value of this field from the milliseconds, which is approximate
if this field is imprecise.
Parameters: duration - the milliseconds to query, which may be negative the value of the field, in the units of the field, which may benegative |
getValue | public int getValue(long duration, long instant)(Code) | | Get the value of this field from the milliseconds relative to an
instant.
If the milliseconds is positive, then the instant is treated as a
"start instant". If negative, the instant is treated as an "end
instant".
The default implementation returns
Utils.safeToInt(getAsLong(millisDuration, instant)) .
Parameters: duration - the milliseconds to query, which may be negative Parameters: instant - the start instant to calculate relative to the value of the field, in the units of the field, which may benegative |
getValueAsLong | public long getValueAsLong(long duration)(Code) | | Get the value of this field from the milliseconds, which is approximate
if this field is imprecise.
Parameters: duration - the milliseconds to query, which may be negative the value of the field, in the units of the field, which may benegative |
isSupported | final public boolean isSupported()(Code) | | true always |
toString | public String toString()(Code) | | Get a suitable debug string.
debug string |
Methods inherited from org.joda.time.DurationField | abstract public long add(long instant, int value)(Code)(Java Doc) abstract public long add(long instant, long value)(Code)(Java Doc) abstract public int compareTo(Object durationField)(Code)(Java Doc) abstract public int getDifference(long minuendInstant, long subtrahendInstant)(Code)(Java Doc) abstract public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)(Code)(Java Doc) abstract public long getMillis(int value)(Code)(Java Doc) abstract public long getMillis(long value)(Code)(Java Doc) abstract public long getMillis(int value, long instant)(Code)(Java Doc) abstract public long getMillis(long value, long instant)(Code)(Java Doc) abstract public String getName()(Code)(Java Doc) abstract public DurationFieldType getType()(Code)(Java Doc) abstract public long getUnitMillis()(Code)(Java Doc) abstract public int getValue(long duration)(Code)(Java Doc) abstract public int getValue(long duration, long instant)(Code)(Java Doc) abstract public long getValueAsLong(long duration)(Code)(Java Doc) abstract public long getValueAsLong(long duration, long instant)(Code)(Java Doc) abstract public boolean isPrecise()(Code)(Java Doc) abstract public boolean isSupported()(Code)(Java Doc) public long subtract(long instant, int value)(Code)(Java Doc) public long subtract(long instant, long value)(Code)(Java Doc) abstract public String toString()(Code)(Java Doc)
|
|
|