public long roundFloor(long instant) { return getWrappedField().roundFloor(instant); }
public long roundHalfFloor(long instant) { return getWrappedField().roundHalfFloor(instant); }
public long roundHalfCeiling(long instant) { return getWrappedField().roundHalfCeiling(instant); }
public long remainder(long instant) { return getWrappedField().remainder(instant); }
/** * Get the remainder from the specified time instant. * * @param instant the time instant in millis to query. * @return the remainder extracted from the input. */ public int get(long instant) { int value = getWrappedField().get(instant); if (value >= 0) { return value % iDivisor; } else { return (iDivisor - 1) + ((value + 1) % iDivisor); } }
public long roundCeiling(long instant) { return getWrappedField().roundCeiling(instant); }
public long roundHalfEven(long instant) { return getWrappedField().roundHalfEven(instant); }
public long roundCeiling(long instant) { return getWrappedField().roundCeiling(instant); }
/** * Get the remainder from the specified time instant. * * @param instant the time instant in millis to query. * @return the remainder extracted from the input. */ public int get(long instant) { int value = getWrappedField().get(instant); if (value >= 0) { return value % iDivisor; } else { return (iDivisor - 1) + ((value + 1) % iDivisor); } }
public long roundFloor(long instant) { return getWrappedField().roundFloor(instant); }
public long roundHalfCeiling(long instant) { return getWrappedField().roundHalfCeiling(instant); }
public long roundHalfEven(long instant) { return getWrappedField().roundHalfEven(instant); }
public long roundHalfFloor(long instant) { return getWrappedField().roundHalfFloor(instant); }
public long remainder(long instant) { return getWrappedField().remainder(instant); }
/** * 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); }
/** * 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); }
/** * Construct a DividedDateTimeField that compliments the given * RemainderDateTimeField. * * @param remainderField complimentary remainder field, like "yearOfCentury()". * @param rangeField the range field, null to derive * @param type the field type this field will actually use */ public DividedDateTimeField(RemainderDateTimeField remainderField, DurationField rangeField, DateTimeFieldType type) { super(remainderField.getWrappedField(), type); int divisor = iDivisor = remainderField.iDivisor; iDurationField = remainderField.iRangeField; iRangeDurationField = rangeField; DateTimeField field = getWrappedField(); int i = field.getMinimumValue(); int min = (i >= 0) ? i / divisor : ((i + 1) / divisor - 1); int j = field.getMaximumValue(); int max = (j >= 0) ? j / divisor : ((j + 1) / divisor - 1); iMin = min; iMax = max; }
/** * Construct a DividedDateTimeField that compliments the given * RemainderDateTimeField. * * @param remainderField complimentary remainder field, like "yearOfCentury()". * @param rangeField the range field, null to derive * @param type the field type this field will actually use */ public DividedDateTimeField(RemainderDateTimeField remainderField, DurationField rangeField, DateTimeFieldType type) { super(remainderField.getWrappedField(), type); int divisor = iDivisor = remainderField.iDivisor; iDurationField = remainderField.iRangeField; iRangeDurationField = rangeField; DateTimeField field = getWrappedField(); int i = field.getMinimumValue(); int min = (i >= 0) ? i / divisor : ((i + 1) / divisor - 1); int j = field.getMaximumValue(); int max = (j >= 0) ? j / divisor : ((j + 1) / divisor - 1); iMin = min; iMax = max; }
public long roundFloor(long instant) { return getWrappedField().roundFloor(instant); }
/** * 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); }