/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }
/** * Creates a new interval with the specified period after the start 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 withPeriodAfterStart(ReadablePeriod period) { if (period == null) { return withDurationAfterStart(null); } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(period, startMillis, 1); return new Interval(startMillis, endMillis, chrono); }