/** @inheritDoc */ public long set(long instant, int era) { FieldUtils.verifyValueBounds(this, era, ERA_VALUE, ERA_VALUE); return instant; }
/** @inheritDoc */ public long set(long instant, int era) { FieldUtils.verifyValueBounds(this, era, ERA_VALUE, ERA_VALUE); return instant; }
/** * Set the specified amount of offset units to the specified time instant. * * @param instant the time instant in millis to update. * @param value value of units to set. * @return the updated time instant. * @throws IllegalArgumentException if value is too large or too small. */ public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, iMin, iMax); return super.set(instant, value - iOffset); }
public long set(long millis, int value) { FieldUtils.verifyValueBounds(this, value, iMinValue, getMaximumValue()); if (value <= iSkip) { value--; } return super.set(millis, value); }
/** * Add the specified amount of offset units to the specified time * instant. The amount added may be negative. * * @param instant the time instant in millis to update. * @param amount the amount of units to add (can be negative). * @return the updated time instant. */ public long add(long instant, long amount) { instant = super.add(instant, amount); FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax); return instant; }
/** * Add the specified amount of offset units to the specified time * instant. The amount added may be negative. * * @param instant the time instant in millis to update. * @param amount the amount of units to add (can be negative). * @return the updated time instant. */ public long add(long instant, int amount) { instant = super.add(instant, amount); FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax); return instant; }
public long set(long instant, int year) { FieldUtils.verifyValueBounds (this, year, iChronology.getMinYear(), iChronology.getMaxYear()); return iChronology.setYear(instant, year); }
/** * Does a bounds check before setting the value. * * @throws IllegalArgumentException if the value is invalid */ public long set(long instant, int value) { FieldUtils.verifyValueBounds (this, value, getMinimumValue(instant), getMaximumValue(instant)); return super.set(instant, value); } }
public long set(long millis, int value) { FieldUtils.verifyValueBounds(this, value, iMinValue, getMaximumValue()); if (value <= iSkip) { if (value == iSkip) { throw new IllegalFieldValueException (DateTimeFieldType.year(), Integer.valueOf(value), null, null); } value++; } return super.set(millis, value); }
public long set(long instant, int value) { int max = getMaximumValue(); FieldUtils.verifyValueBounds(this, value, 1, max); if (value == max) { value = 0; } return getWrappedField().set(instant, value); }
@Override public long setExtended(long instant, int year) { FieldUtils.verifyValueBounds( this, year, iChronology.getMinYear() - 1, iChronology.getMaxYear() + 1); return iChronology.setYear(instant, year); }
/** * Set the specified amount of units to the specified time instant. * * @param instant the milliseconds from 1970-01-01T00:00:00Z to set in * @param value value of units to set. * @return the updated time instant. * @throws IllegalArgumentException if value is too large or too small. */ public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, getMinimumValue(), getMaximumValue()); return instant + (value - get(instant)) * iUnitMillis; }
/** * Set the specified amount of units to the specified time instant. * * @param instant the milliseconds from 1970-01-01T00:00:00Z to set in * @param value value of units to set. * @return the updated time instant. * @throws IllegalArgumentException if value is too large or too small. */ public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, getMinimumValue(), getMaximumValueForSet(instant, value)); return instant + (value - get(instant)) * iUnitMillis; }
public long set(long instant, int year) { FieldUtils.verifyValueBounds (this, year, iChronology.getMinYear(), iChronology.getMaxYear()); return iChronology.setYear(instant, year); }
@Override public long setExtended(long instant, int year) { FieldUtils.verifyValueBounds( this, year, iChronology.getMinYear() - 1, iChronology.getMaxYear() + 1); return iChronology.setYear(instant, year); }
@Override public long getDateTimeMillis( int year, int monthOfYear, int dayOfMonth, int millisOfDay) throws IllegalArgumentException { Chronology base; if ((base = getBase()) != null) { return base.getDateTimeMillis(year, monthOfYear, dayOfMonth, millisOfDay); } FieldUtils.verifyValueBounds (DateTimeFieldType.millisOfDay(), millisOfDay, 0, DateTimeConstants.MILLIS_PER_DAY - 1); return getDateTimeMillis0(year, monthOfYear, dayOfMonth, millisOfDay); }
public long set(long instant, int year) { FieldUtils.verifyValueBounds(this, year, 0, getMaximumValue()); if (getWrappedField().get(instant) < 0) { year = -year; } return super.set(instant, year); }
public long set(long instant, int year) { FieldUtils.verifyValueBounds(this, year, 0, getMaximumValue()); if (getWrappedField().get(instant) < 0) { year = -year; } return super.set(instant, year); }
/** * Set the specified amount of scaled units to the specified time instant. * * @param instant the time instant in millis to update. * @param value value of scaled units to set. * @return the updated time instant. * @throws IllegalArgumentException if value is too large or too small. */ public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, iMin, iMax); int remainder = getRemainder(getWrappedField().get(instant)); return getWrappedField().set(instant, value * iDivisor + remainder); }
/** * Set the specified amount of remainder units to the specified time instant. * * @param instant the time instant in millis to update. * @param value value of remainder units to set. * @return the updated time instant. * @throws IllegalArgumentException if value is too large or too small. */ public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, 0, iDivisor - 1); int divided = getDivided(getWrappedField().get(instant)); return getWrappedField().set(instant, divided * iDivisor + value); }