/** * Creates a new interval with the specified period before the end instant. * * @param period the period to subtract from the end to get the new start instant, null means zero * @return an interval with the end from this interval and a calculated start * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to subtract from the end to get the new start instant, null means zero * @return an interval with the end from this interval and a calculated start * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to subtract from the end to get the new start instant, null means zero * @return an interval with the end from this interval and a calculated start * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to subtract from the end to get the new start instant, null means zero * @return an interval with the end from this interval and a calculated start * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period before the end instant. * * @param period the period to add to the start to get the new end instant, null means zero * @return an interval with the start from this interval and a calculated end * @throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd(ReadablePeriod period) { if (period == null) { return withDurationBeforeEnd(null); } Chronology chrono = getChronology(); long endMillis = getEndMillis(); long startMillis = chrono.add(period, endMillis, -1); return new Interval(startMillis, endMillis, chrono); }