public long getMillis(int value, long instant) { return ImpreciseDateTimeField.this.add(instant, value) - instant; }
public int getDifference(long minuendInstant, long subtrahendInstant) { return ImpreciseDateTimeField.this .getDifference(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return ImpreciseDateTimeField.this .getDifferenceAsLong(minuendInstant, subtrahendInstant); } }
return -getDifferenceAsLong(subtrahendInstant, minuendInstant); if (add(subtrahendInstant, difference) < minuendInstant) { do { difference++; } while (add(subtrahendInstant, difference) <= minuendInstant); difference--; } else if (add(subtrahendInstant, difference) > minuendInstant) { do { difference--; } while (add(subtrahendInstant, difference) > minuendInstant);
return -getDifferenceAsLong(subtrahendInstant, minuendInstant); if (add(subtrahendInstant, difference) < minuendInstant) { do { difference++; } while (add(subtrahendInstant, difference) <= minuendInstant); difference--; } else if (add(subtrahendInstant, difference) > minuendInstant) { do { difference--; } while (add(subtrahendInstant, difference) > minuendInstant);
public long add(long instant, long value) { return ImpreciseDateTimeField.this.add(instant, value); }
public long getValueAsLong(long duration, long instant) { return ImpreciseDateTimeField.this .getDifferenceAsLong(instant + duration, instant); }
return -getDifferenceAsLong(subtrahendInstant, minuendInstant); if (add(subtrahendInstant, difference) < minuendInstant) { do { difference++; } while (add(subtrahendInstant, difference) <= minuendInstant); difference--; } else if (add(subtrahendInstant, difference) > minuendInstant) { do { difference--; } while (add(subtrahendInstant, difference) > minuendInstant);
public int getValue(long duration, long instant) { return ImpreciseDateTimeField.this .getDifference(instant + duration, instant); }
public long getMillis(long value, long instant) { return ImpreciseDateTimeField.this.add(instant, value) - instant; }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return ImpreciseDateTimeField.this .getDifferenceAsLong(minuendInstant, subtrahendInstant); } }
return -getDifferenceAsLong(subtrahendInstant, minuendInstant); if (add(subtrahendInstant, difference) < minuendInstant) { do { difference++; } while (add(subtrahendInstant, difference) <= minuendInstant); difference--; } else if (add(subtrahendInstant, difference) > minuendInstant) { do { difference--; } while (add(subtrahendInstant, difference) > minuendInstant);
public int getDifference(long minuendInstant, long subtrahendInstant) { return ImpreciseDateTimeField.this .getDifference(minuendInstant, subtrahendInstant); }
public long add(long instant, int value) { return ImpreciseDateTimeField.this.add(instant, value); }
public long getValueAsLong(long duration, long instant) { return ImpreciseDateTimeField.this .getDifferenceAsLong(instant + duration, instant); }
return -getDifferenceAsLong(subtrahendInstant, minuendInstant); if (add(subtrahendInstant, difference) < minuendInstant) { do { difference++; } while (add(subtrahendInstant, difference) <= minuendInstant); difference--; } else if (add(subtrahendInstant, difference) > minuendInstant) { do { difference--; } while (add(subtrahendInstant, difference) > minuendInstant);
public int getValue(long duration, long instant) { return ImpreciseDateTimeField.this .getDifference(instant + duration, instant); }
public long getMillis(int value, long instant) { return ImpreciseDateTimeField.this.add(instant, value) - instant; }
/** * Computes the difference between two instants, as measured in the units * of this field. Any fractional units are dropped from the result. Calling * getDifference reverses the effect of calling add. In the following code: * * <pre> * long instant = ... * int v = ... * int age = getDifference(add(instant, v), instant); * </pre> * * The value 'age' is the same as the value 'v'. * <p> * The default implementation call getDifferenceAsLong and converts the * return value to an int. * * @param minuendInstant the milliseconds from 1970-01-01T00:00:00Z to * subtract from * @param subtrahendInstant the milliseconds from 1970-01-01T00:00:00Z to * subtract off the minuend * @return the difference in the units of this field */ public int getDifference(long minuendInstant, long subtrahendInstant) { return FieldUtils.safeToInt(getDifferenceAsLong(minuendInstant, subtrahendInstant)); }
return -getDifferenceAsLong(subtrahendInstant, minuendInstant); if (add(subtrahendInstant, difference) < minuendInstant) { do { difference++; } while (add(subtrahendInstant, difference) <= minuendInstant); difference--; } else if (add(subtrahendInstant, difference) > minuendInstant) { do { difference--; } while (add(subtrahendInstant, difference) > minuendInstant);