public final class UnsupportedDurationField extends DurationField implements Serializable
UnsupportedDurationField is thread-safe and immutable.
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
subtract, subtractpublic static UnsupportedDurationField getInstance(DurationFieldType type)
type - the type to obtainpublic final DurationFieldType getType()
DurationFieldgetType 在类中 DurationFieldpublic String getName()
DurationFieldBy convention, names are plural.
getName 在类中 DurationFieldpublic boolean isSupported()
isSupported 在类中 DurationFieldpublic boolean isPrecise()
isPrecise 在类中 DurationFieldDurationField.getUnitMillis()public int getValue(long duration)
getValue 在类中 DurationFieldduration - the milliseconds to query, which may be negativeUnsupportedOperationExceptionpublic long getValueAsLong(long duration)
getValueAsLong 在类中 DurationFieldduration - the milliseconds to query, which may be negativeUnsupportedOperationExceptionpublic int getValue(long duration,
long instant)
getValue 在类中 DurationFieldduration - the milliseconds to query, which may be negativeinstant - the start instant to calculate relative toUnsupportedOperationExceptionpublic long getValueAsLong(long duration,
long instant)
getValueAsLong 在类中 DurationFieldduration - the milliseconds to query, which may be negativeinstant - the start instant to calculate relative toUnsupportedOperationExceptionpublic long getMillis(int value)
getMillis 在类中 DurationFieldvalue - the value of the field, which may be negativeUnsupportedOperationExceptionpublic long getMillis(long value)
getMillis 在类中 DurationFieldvalue - the value of the field, which may be negativeUnsupportedOperationExceptionpublic long getMillis(int value,
long instant)
getMillis 在类中 DurationFieldvalue - the value of the field, which may be negativeinstant - the instant to calculate relative toUnsupportedOperationExceptionpublic long getMillis(long value,
long instant)
getMillis 在类中 DurationFieldvalue - the value of the field, which may be negativeinstant - the instant to calculate relative toUnsupportedOperationExceptionpublic long add(long instant,
int value)
add 在类中 DurationFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to add tovalue - the value to add, in the units of the fieldUnsupportedOperationExceptionpublic long add(long instant,
long value)
add 在类中 DurationFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to add tovalue - the value to add, in the units of the fieldUnsupportedOperationExceptionpublic int getDifference(long minuendInstant,
long subtrahendInstant)
getDifference 在类中 DurationFieldminuendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuendUnsupportedOperationExceptionpublic long getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
getDifferenceAsLong 在类中 DurationFieldminuendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuendUnsupportedOperationExceptionpublic long getUnitMillis()
getUnitMillis 在类中 DurationFieldDurationField.isPrecise()public int compareTo(DurationField durationField)
compareTo 在接口中 Comparable<DurationField>public boolean equals(Object obj)
public String toString()
toString 在类中 DurationFieldCopyright © 2019. All rights reserved.