/** * Adds a period to this instant. * <p> * This will typically change the value of most fields. * * @param period the period to add, null means add zero * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadablePeriod period) { add(period, 1); }
public void eval() { temp.setMillis(left.value); temp.addMonths(right.months * -1 ); temp.addDays(right.days * -1 ); temp.add(right.milliseconds * -1 ); out.value = temp.getMillis(); } }
public void eval() { temp.setMillis(left.value); temp.addDays(right.days * -1 ); temp.add(right.milliseconds * -1 ); out.value = temp.getMillis(); } }
/** * Adds a duration to this instant. * <p> * This will typically change the value of most fields. * * @param duration the duration to add, null means add zero * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadableDuration duration) { add(duration, 1); }
public void eval() { temp.setMillis(left.value); temp.addDays(right.days * -1 ); temp.add(right.milliseconds * -1 ); out.value = temp.getMillis(); } }
/** * Adds a period to this instant. * <p> * This will typically change the value of most fields. * * @param period the period to add, null means add zero * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadablePeriod period) { add(period, 1); }
public void eval() { temp.setMillis(left.value); temp.addDays(right.days ); temp.add(right.milliseconds ); out.value = temp.getMillis(); } }
/** * Adds a duration to this instant. * <p> * This will typically change the value of most fields. * * @param duration the duration to add, null means add zero * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadableDuration duration) { add(duration, 1); }
/** * Adds a duration to this instant specifying how many times to add. * <p> * This will typically change the value of most fields. * * @param duration the duration to add, null means add zero * @param scalar direction and amount to add, which may be negative * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadableDuration duration, int scalar) { if (duration != null) { add(FieldUtils.safeMultiply(duration.getMillis(), scalar)); } }
private void fillEmptyTimestamps(Map<Long, Map<String, Number>> results) { final long minTimestamp = Collections.min(results.keySet()); final long maxTimestamp = Collections.max(results.keySet()); final MutableDateTime currentTime = new MutableDateTime(minTimestamp, DateTimeZone.UTC); while (currentTime.getMillis() < maxTimestamp) { final Map<String, Number> entry = results.get(currentTime.getMillis()); // advance timestamp by the interval currentTime.add(interval.getPeriod()); if (entry == null) { // synthesize a 0 value for this timestamp results.put(currentTime.getMillis(), EMPTY_RESULT); } } }
/** * Adds a duration to this instant specifying how many times to add. * <p> * This will typically change the value of most fields. * * @param duration the duration to add, null means add zero * @param scalar direction and amount to add, which may be negative * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadableDuration duration, int scalar) { if (duration != null) { add(FieldUtils.safeMultiply(duration.getMillis(), scalar)); } }
/** * Adds a duration to this instant. * <p> * This will typically change the value of most fields. * * @param duration the duration to add, null means add zero * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadableDuration duration) { add(duration, 1); }
/** * Adds a period to this instant. * <p> * This will typically change the value of most fields. * * @param period the period to add, null means add zero * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadablePeriod period) { add(period, 1); }
/** * Adds a duration to this instant specifying how many times to add. * <p> * This will typically change the value of most fields. * * @param duration the duration to add, null means add zero * @param scalar direction and amount to add, which may be negative * @throws ArithmeticException if the result exceeds the capacity of the instant */ public void add(ReadableDuration duration, int scalar) { if (duration != null) { add(FieldUtils.safeMultiply(duration.getMillis(), scalar)); } }
public void eval() { dateTime.setMillis(0); dateTime.add(org.joda.time.DurationFieldType.years(), (in.value / org.apache.arrow.vector.util.DateUtility.yearsToMonths)); dateTime.add(org.joda.time.DurationFieldType.months(), (in.value % org.apache.arrow.vector.util.DateUtility.yearsToMonths)); out.value = dateTime.getMillis()/1000; } }
public void eval() { dateTime.setRounding(null, org.joda.time.MutableDateTime.ROUND_NONE); dateTime.setMillis(right.value); dateTime.add(org.joda.time.DurationFieldType.years(), -1); dateTime.setRounding(dateTime.getChronology().centuryOfEra()); dateTime2.setMillis(dateTime.getMillis()); dateTime2.add(org.joda.time.DurationFieldType.years(), 1); out.value = dateTime2.getMillis(); } }
public void eval() { dateTime.setMillis(right.value); int month = dateTime.getMonthOfYear(); dateTime.setRounding(dateTime.getChronology().year()); dateTime2.setMillis(dateTime.getMillis()); dateTime2.add(org.joda.time.DurationFieldType.months(), ((month-1)/3)*3); out.value = dateTime2.getMillis(); } }
public void eval() { dateTime.setRounding(null, org.joda.time.MutableDateTime.ROUND_NONE); dateTime.setMillis(right.value); int year = dateTime.getYear(); dateTime.setRounding(dateTime.getChronology().era()); dateTime2.setMillis(dateTime.getMillis()); dateTime2.add(org.joda.time.DurationFieldType.years(), ((year-1)/1000)*1000); out.value = dateTime2.getMillis(); } }
public void eval() { dateTime.setRounding(null, org.joda.time.MutableDateTime.ROUND_NONE); dateTime.setMillis(right.value); int month = dateTime.getMonthOfYear(); dateTime.setRounding(dateTime.getChronology().year()); dateTime2.setMillis(dateTime.getMillis()); dateTime2.add(org.joda.time.DurationFieldType.months(), ((month-1)/3)*3); out.value = dateTime2.getMillis(); } }
public void eval() { dateTime.setRounding(null, org.joda.time.MutableDateTime.ROUND_NONE); dateTime.setMillis(right.value); int year = dateTime.getYear(); dateTime.setRounding(dateTime.getChronology().centuryOfEra()); dateTime2.setMillis(dateTime.getMillis()); dateTime2.add(org.joda.time.DurationFieldType.years(), ((year%100)/10)*10); out.value = dateTime2.getMillis(); } }