/** * Multiply the period by an integer * @param value multiply by this * @return new period */ public CalendarPeriod multiply(int value) { return new CalendarPeriod(this.value * value, this.field); }
/** * Multiply the period by an integer * @param value multiply by this * @return new period */ public CalendarPeriod multiply(int value) { return new CalendarPeriod(this.value * value, this.field); }
public static CalendarPeriod of(int value, Field field) { return new CalendarPeriod(value, field); }
public static CalendarPeriod of(int value, Field field) { return new CalendarPeriod(value, field); }
public static CalendarPeriod of(int value, Field field) { CalendarPeriod want = new CalendarPeriod(value, field); if (cache == null) return want; CalendarPeriod got = cache.getIfPresent(want); if (got != null) return got; cache.put(want, want); return want; }
public static void main(String[] args) { CalendarPeriod cp = new CalendarPeriod(1, Field.Day); CalendarDate start = CalendarDate.parseUdunits(null, "3 days since 1970-01-01 12:00"); CalendarDate end = CalendarDate.parseUdunits(null, "6 days since 1970-01-01 12:00"); int offset = cp.getOffset(start, end); System.out.printf("offset=%d%n", offset); } }
public static void main(String[] args) { CalendarPeriod cp = new CalendarPeriod(1, Field.Day); CalendarDate start = CalendarDate.parseUdunits(null, "3 days since 1970-01-01 12:00"); CalendarDate end = CalendarDate.parseUdunits(null, "6 days since 1970-01-01 12:00"); int offset = cp.getOffset(start, end); System.out.printf("offset=%d%n", offset); } }