|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joda.time.field.AbstractPartialFieldProperty org.joda.time.YearMonth.Property
public static class YearMonth.Property
The property class for YearMonth
.
This class binds a YearMonth
to a DateTimeField
.
Method Summary | |
---|---|
YearMonth |
addToCopy(int valueToAdd)
Adds to the value of this field in a copy of this YearMonth. |
YearMonth |
addWrapFieldToCopy(int valueToAdd)
Adds to the value of this field in a copy of this YearMonth wrapping within this field if the maximum value is reached. |
int |
get()
Gets the value of this field. |
DateTimeField |
getField()
Gets the field that this property uses. |
protected ReadablePartial |
getReadablePartial()
Gets the partial that this property belongs to. |
YearMonth |
getYearMonth()
Gets the partial that this property belongs to. |
YearMonth |
setCopy(int value)
Sets this field in a copy of the YearMonth. |
YearMonth |
setCopy(String text)
Sets this field in a copy of the YearMonth to a parsed text value. |
YearMonth |
setCopy(String text,
Locale locale)
Sets this field in a copy of the YearMonth to a parsed text value. |
Methods inherited from class org.joda.time.field.AbstractPartialFieldProperty |
---|
compareTo, compareTo, equals, getAsShortText, getAsShortText, getAsString, getAsText, getAsText, getDurationField, getFieldType, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValueOverall, getMinimumValue, getMinimumValueOverall, getName, getRangeDurationField, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public DateTimeField getField()
getField
in class AbstractPartialFieldProperty
protected ReadablePartial getReadablePartial()
getReadablePartial
in class AbstractPartialFieldProperty
public YearMonth getYearMonth()
public int get()
get
in class AbstractPartialFieldProperty
public YearMonth addToCopy(int valueToAdd)
The value will be added to this field. If the value is too large to be added solely to this field then it will affect larger fields. Smaller fields are unaffected.
If the result would be too large, beyond the maximum year, then an IllegalArgumentException is thrown.
The YearMonth attached to this property is unchanged by this call. Instead, a new instance is returned.
valueToAdd
- the value to add to the field in the copy
IllegalArgumentException
- if the value isn't validpublic YearMonth addWrapFieldToCopy(int valueToAdd)
The value will be added to this field. If the value is too large to be added solely to this field then it wraps within this field. Other fields are unaffected.
For example,
2004-12
addWrapField one month returns 2004-01
.
The YearMonth attached to this property is unchanged by this call. Instead, a new instance is returned.
valueToAdd
- the value to add to the field in the copy
IllegalArgumentException
- if the value isn't validpublic YearMonth setCopy(int value)
The YearMonth attached to this property is unchanged by this call. Instead, a new instance is returned.
value
- the value to set the field in the copy to
IllegalArgumentException
- if the value isn't validpublic YearMonth setCopy(String text, Locale locale)
The YearMonth attached to this property is unchanged by this call. Instead, a new instance is returned.
text
- the text value to setlocale
- optional locale to use for selecting a text symbol
IllegalArgumentException
- if the text value isn't validpublic YearMonth setCopy(String text)
The YearMonth attached to this property is unchanged by this call. Instead, a new instance is returned.
text
- the text value to set
IllegalArgumentException
- if the text value isn't valid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |