|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joda.time.DurationField org.joda.time.field.UnsupportedDurationField
public final class UnsupportedDurationField
A placeholder implementation to use when a duration field is not supported.
UnsupportedDurationField is thread-safe and immutable.
Method Summary | |
---|---|
long |
add(long instant,
int value)
Always throws UnsupportedOperationException |
long |
add(long instant,
long value)
Always throws UnsupportedOperationException |
int |
compareTo(DurationField durationField)
Always returns zero, indicating that sort order is not relevent. |
boolean |
equals(Object obj)
Compares this duration field to another. |
int |
getDifference(long minuendInstant,
long subtrahendInstant)
Always throws UnsupportedOperationException |
long |
getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
Always throws UnsupportedOperationException |
static UnsupportedDurationField |
getInstance(DurationFieldType type)
Gets an instance of UnsupportedDurationField for a specific named field. |
long |
getMillis(int value)
Always throws UnsupportedOperationException |
long |
getMillis(int value,
long instant)
Always throws UnsupportedOperationException |
long |
getMillis(long value)
Always throws UnsupportedOperationException |
long |
getMillis(long value,
long instant)
Always throws UnsupportedOperationException |
String |
getName()
Get the name of the field. |
DurationFieldType |
getType()
Get the type of the field. |
long |
getUnitMillis()
Always returns zero. |
int |
getValue(long duration)
Always throws UnsupportedOperationException |
int |
getValue(long duration,
long instant)
Always throws UnsupportedOperationException |
long |
getValueAsLong(long duration)
Always throws UnsupportedOperationException |
long |
getValueAsLong(long duration,
long instant)
Always throws UnsupportedOperationException |
int |
hashCode()
Gets a suitable hashcode. |
boolean |
isPrecise()
This field is precise. |
boolean |
isSupported()
This field is not supported. |
String |
toString()
Get a suitable debug string. |
Methods inherited from class org.joda.time.DurationField |
---|
subtract, subtract |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static UnsupportedDurationField getInstance(DurationFieldType type)
type
- the type to obtain
public final DurationFieldType getType()
DurationField
getType
in class DurationField
public String getName()
DurationField
By convention, names are plural.
getName
in class DurationField
public boolean isSupported()
isSupported
in class DurationField
public boolean isPrecise()
isPrecise
in class DurationField
DurationField.getUnitMillis()
public int getValue(long duration)
getValue
in class DurationField
duration
- the milliseconds to query, which may be negative
UnsupportedOperationException
public long getValueAsLong(long duration)
getValueAsLong
in class DurationField
duration
- the milliseconds to query, which may be negative
UnsupportedOperationException
public int getValue(long duration, long instant)
getValue
in class DurationField
duration
- the milliseconds to query, which may be negativeinstant
- the start instant to calculate relative to
UnsupportedOperationException
public long getValueAsLong(long duration, long instant)
getValueAsLong
in class DurationField
duration
- the milliseconds to query, which may be negativeinstant
- the start instant to calculate relative to
UnsupportedOperationException
public long getMillis(int value)
getMillis
in class DurationField
value
- the value of the field, which may be negative
UnsupportedOperationException
public long getMillis(long value)
getMillis
in class DurationField
value
- the value of the field, which may be negative
UnsupportedOperationException
public long getMillis(int value, long instant)
getMillis
in class DurationField
value
- the value of the field, which may be negativeinstant
- the instant to calculate relative to
UnsupportedOperationException
public long getMillis(long value, long instant)
getMillis
in class DurationField
value
- the value of the field, which may be negativeinstant
- the instant to calculate relative to
UnsupportedOperationException
public long add(long instant, int value)
add
in class DurationField
instant
- the milliseconds from 1970-01-01T00:00:00Z to add tovalue
- the value to add, in the units of the field
UnsupportedOperationException
public long add(long instant, long value)
add
in class DurationField
instant
- the milliseconds from 1970-01-01T00:00:00Z to add tovalue
- the value to add, in the units of the field
UnsupportedOperationException
public int getDifference(long minuendInstant, long subtrahendInstant)
getDifference
in class DurationField
minuendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuend
UnsupportedOperationException
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)
getDifferenceAsLong
in class DurationField
minuendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuend
UnsupportedOperationException
public long getUnitMillis()
getUnitMillis
in class DurationField
DurationField.isPrecise()
public int compareTo(DurationField durationField)
compareTo
in interface Comparable<DurationField>
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare to
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class DurationField
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |