/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }
/** * Creates a period from the given interval endpoints. * * @param startInstant interval start, null means now * @param endInstant interval end, null means now * @param type which set of fields this period supports, null means standard * @throws IllegalArgumentException if period type is invalid */ protected BasePeriod(ReadableInstant startInstant, ReadableInstant endInstant, PeriodType type) { super(); type = checkPeriodType(type); if (startInstant == null && endInstant == null) { iType = type; iValues = new int[size()]; } else { long startMillis = DateTimeUtils.getInstantMillis(startInstant); long endMillis = DateTimeUtils.getInstantMillis(endInstant); Chronology chrono = DateTimeUtils.getIntervalChronology(startInstant, endInstant); iType = type; iValues = chrono.get(this, startMillis, endMillis); } }
/** * Creates a period from the given interval endpoints. * * @param startInstant interval start, null means now * @param endInstant interval end, null means now * @param type which set of fields this period supports, null means standard * @throws IllegalArgumentException if period type is invalid */ protected BasePeriod(ReadableInstant startInstant, ReadableInstant endInstant, PeriodType type) { super(); type = checkPeriodType(type); if (startInstant == null && endInstant == null) { iType = type; iValues = new int[size()]; } else { long startMillis = DateTimeUtils.getInstantMillis(startInstant); long endMillis = DateTimeUtils.getInstantMillis(endInstant); Chronology chrono = DateTimeUtils.getIntervalChronology(startInstant, endInstant); iType = type; iValues = chrono.get(this, startMillis, endMillis); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Creates a period from the given interval endpoints. * * @param startInstant interval start, null means now * @param endInstant interval end, null means now * @param type which set of fields this period supports, null means standard * @throws IllegalArgumentException if period type is invalid */ protected BasePeriod(ReadableInstant startInstant, ReadableInstant endInstant, PeriodType type) { super(); type = checkPeriodType(type); if (startInstant == null && endInstant == null) { iType = type; iValues = new int[size()]; } else { long startMillis = DateTimeUtils.getInstantMillis(startInstant); long endMillis = DateTimeUtils.getInstantMillis(endInstant); Chronology chrono = DateTimeUtils.getIntervalChronology(startInstant, endInstant); iType = type; iValues = chrono.get(this, startMillis, endMillis); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets the values of the mutable duration from the specified interval. * * @param writablePeriod the period to modify * @param object the interval to set from * @param chrono the chronology to use */ public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) { ReadableInterval interval = (ReadableInterval) object; chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval)); long start = interval.getStartMillis(); long end = interval.getEndMillis(); int[] values = chrono.get(writablePeriod, start, end); for (int i = 0; i < values.length; i++) { writablePeriod.setValue(i, values[i]); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }
/** * Sets all the fields in one go from two instants representing an interval. * <p> * The chronology of the start instant is used, unless that is null when the * chronology of the end instant is used instead. * * @param start the start instant, null means now * @param end the end instant, null means now * @throws ArithmeticException if the set exceeds the capacity of the period */ public void setPeriod(ReadableInstant start, ReadableInstant end) { if (start == end) { setPeriod(0L); } else { long startMillis = DateTimeUtils.getInstantMillis(start); long endMillis = DateTimeUtils.getInstantMillis(end); Chronology chrono = DateTimeUtils.getIntervalChronology(start, end); setPeriod(startMillis, endMillis, chrono); } }