|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.joda.time.DateTimeFieldProperty
DateTimeFieldProperty binds a ReadableInstant to a DateTimeField.
DateTimeFieldProperty allows the date and time manipulation code to be field based yet still easy to use.
ReadableInstant,
DateTimeField,
Serialized Form| Constructor Summary | |
DateTimeFieldProperty(ReadableInstant instant,
DateTimeField field)
Constructor. |
|
| Method Summary | |
int |
compareTo(ReadableInstant instant)
Compare this field to the same field on another instant. |
int |
get()
Gets a value from the instant. |
java.lang.String |
getAsShortText()
Gets a short text value from the instant. |
java.lang.String |
getAsShortText(java.util.Locale locale)
Gets a short text value from the instant. |
java.lang.String |
getAsText()
Gets a text value from the instant. |
java.lang.String |
getAsText(java.util.Locale locale)
Gets a text value from the instant. |
long |
getDifference(ReadableInstant instant)
Returns the difference between this field property instant and the one passed in, in the units of this field. |
DateTimeField |
getField()
Gets the field being used. |
ReadableInstant |
getInstant()
Gets the instant being used. |
int |
getLeapAmount()
Gets the amount by which this field is leap. |
int |
getMaximumShortTextLength(java.util.Locale locale)
Gets the maximum short text length for the field. |
int |
getMaximumTextLength(java.util.Locale locale)
Gets the maximum text length for the field. |
int |
getMaximumValue()
Gets the maximum value for the field. |
int |
getMaximumValueOverall()
Gets the maximum value for the field ignoring the current time. |
int |
getMinimumValue()
Gets the minimum value for the field. |
int |
getMinimumValueOverall()
Gets the minimum value for the field ignoring the current time. |
java.lang.String |
getName()
Gets the name of the field. |
long |
getRangeMillis()
Returns the range of this field, in milliseconds. |
long |
getUnitMillis()
Returns the amount of milliseconds per unit value of this field. |
boolean |
isLeap()
Gets whether this field is leap. |
java.lang.String |
toString()
Output a debugging string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DateTimeFieldProperty(ReadableInstant instant,
DateTimeField field)
instant - the instant to setfield - the field to use| Method Detail |
public DateTimeField getField()
public java.lang.String getName()
public ReadableInstant getInstant()
public int get()
DateTimeField.get(long)public java.lang.String getAsText(java.util.Locale locale)
locale - optional locale to use for selecting a text symbol
DateTimeField.getAsText(long, java.util.Locale)public final java.lang.String getAsText()
DateTimeField.getAsText(long, java.util.Locale)public java.lang.String getAsShortText(java.util.Locale locale)
locale - optional locale to use for selecting a text symbol
DateTimeField.getAsShortText(long, java.util.Locale)public final java.lang.String getAsShortText()
DateTimeField.getAsShortText(long, java.util.Locale)public long getDifference(ReadableInstant instant)
instant - the subtrahend
DateTimeField.getDifference(long, long)public boolean isLeap()
DateTimeField.isLeap(long)public int getLeapAmount()
DateTimeField.getLeapAmount(long)public int getMinimumValueOverall()
DateTimeField.getMinimumValue()public int getMinimumValue()
DateTimeField.getMinimumValue()public int getMaximumValueOverall()
DateTimeField.getMaximumValue()public int getMaximumValue()
DateTimeField.getMaximumValue()public int getMaximumTextLength(java.util.Locale locale)
locale - optional locale to use for selecting a text symbol
DateTimeField.getMaximumTextLength(java.util.Locale)public int getMaximumShortTextLength(java.util.Locale locale)
locale - optional locale to use for selecting a text symbol
DateTimeField.getMaximumShortTextLength(java.util.Locale)public long getUnitMillis()
For fields with a variable unit size, this method returns a suitable average value.
public long getRangeMillis()
For fields with a variable range, this method returns a suitable average value. If the range is too large to fit in a long, Long.MAX_VALUE is returned.
public int compareTo(ReadableInstant instant)
The get() method is used to obtain the value to compare for
this instant and the ReadableInstant.get(DateTimeField) method
is used for the specified instant.
instant - the instant to compare to
java.lang.IllegalArgumentException - if the instant is nullpublic java.lang.String toString()
toString in class java.lang.Object
|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||