/** * Get the year field value. * * @return the year */ public int getYear() { return getValue(YEAR); }
/** * Returns a copy of this year-month with the specified field set to a new value. * <p> * For example, if the field type is <code>monthOfYear</code> then the month * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * YearMonth updated = ym.withField(DateTimeFieldType.monthOfYear(), 6); * YearMonth updated = ym.monthOfYear().setCopy(6); * YearMonth updated = ym.property(DateTimeFieldType.monthOfYear()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public YearMonth withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new YearMonth(this, newValues); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }
/** * Returns a copy of this year-month with the specified field set to a new value. * <p> * For example, if the field type is <code>monthOfYear</code> then the month * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * YearMonth updated = ym.withField(DateTimeFieldType.monthOfYear(), 6); * YearMonth updated = ym.monthOfYear().setCopy(6); * YearMonth updated = ym.property(DateTimeFieldType.monthOfYear()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public YearMonth withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new YearMonth(this, newValues); }
/** * Gets the value of this field. * * @return the field value */ public int get() { return iBase.getValue(iFieldIndex); }
/** * Returns a copy of this year-month with the specified field set to a new value. * <p> * For example, if the field type is <code>monthOfYear</code> then the month * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * YearMonth updated = ym.withField(DateTimeFieldType.monthOfYear(), 6); * YearMonth updated = ym.monthOfYear().setCopy(6); * YearMonth updated = ym.property(DateTimeFieldType.monthOfYear()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public YearMonth withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new YearMonth(this, newValues); }
/** * Get the year field value. * * @return the year */ public int getYear() { return getValue(YEAR); }
/** * Gets the value of this field. * * @return the field value */ public int get() { return iBase.getValue(iFieldIndex); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }
/** * Gets the value of this field. * * @return the field value */ public int get() { return iBase.getValue(iFieldIndex); }
/** * Get the year field value. * * @return the year */ public int getYear() { return getValue(YEAR); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }
/** * Get the year field value. * * @return the year */ public int getYear() { return getValue(YEAR); }
/** * Get the year field value. * * @return the year */ public int getYear() { return getValue(YEAR); }
/** * Gets the value of this field. * * @return the field value */ public int get() { return iBase.getValue(iFieldIndex); }
/** * Gets the value of this field. * * @return the field value */ public int get() { return iBase.getValue(iFieldIndex); }
/** * Get the month of year field value. * * @return the month of year */ public int getMonthOfYear() { return getValue(MONTH_OF_YEAR); }