/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
/** * Gets the period type, which is <code>months</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.months(); }
private static PeriodType getPeriodType(OrgInterval.Unit unit) { switch (unit) { case HOUR: return PeriodType.hours(); case DAY: return PeriodType.days(); case WEEK: return PeriodType.weeks(); case MONTH: return PeriodType.months(); case YEAR: return PeriodType.years(); default: throw new IllegalArgumentException("Unknown unit " + unit); } }
@Override public Period random() { return new Period(RandomData.randomLong(0, 1000), RandomData.random( Arrays.asList( PeriodType.millis(), PeriodType.seconds(), PeriodType.minutes(), PeriodType.hours(), PeriodType.days(), PeriodType.weeks(), PeriodType.months(), PeriodType.years() ))); }
public int difference(DateTime from, DateTime to) { if(this==WEEK) throw new UnsupportedOperationException(); from = truncate(from); to = truncate(to); PeriodType pt = PeriodType.minutes(); if (this == HOUR) pt = PeriodType.hours(); else if (this == DAY) pt = PeriodType.days(); else if (this == MONTH || this == QUARTER) pt = PeriodType.months(); else if (this == YEAR) pt = PeriodType.years(); Period p = new Period(from, to, pt); if (this == MINUTE) return p.getMinutes(); else if (this == HOUR) return p.getHours(); else if (this == DAY) return p.getDays(); else if (this == MONTH) return p.getMonths(); else if (this == QUARTER) return p.getMonths() / 3; return p.getYears(); }