/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getStart()) .append((duration == null) ? getEnd() : duration) .toHashCode(); } }
/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getStart()) .append((duration == null) ? getEnd() : duration) .toHashCode(); } }
/** * {@inheritDoc} */ public final int hashCode() { return new HashCodeBuilder().append(getStart()) .append((duration == null) ? (Object) getEnd() : duration).toHashCode(); } }
/** * An empty period is one that consumes no time. * @return true if this period consumes no time, otherwise false */ public final boolean isEmpty() { return getStart().equals(getEnd()); }
/** * Convenience method for retrieving recurrences in a specified period. * * @param seed a seed date for generating recurrence instances * @param period the period of returned recurrence dates * @param value type of dates to generate * @return a list of dates */ public final DateList getDates(final Date seed, final Period period, final Value value) { return getDates(seed, period.getStart(), period.getEnd(), value, -1); }
/** * An empty period is one that consumes no time. * @return true if this period consumes no time, otherwise false */ public final boolean isEmpty() { return getStart().equals(getEnd()); }
/** * Convenience method for retrieving recurrences in a specified period. * @param seed a seed date for generating recurrence instances * @param period the period of returned recurrence dates * @param value type of dates to generate * @return a list of dates */ public final DateList getDates(final Date seed, final Period period, final Value value) { return getDates(seed, period.getStart(), period.getEnd(), value, -1); }
/** * Returns the duration of this period. If an explicit duration is not * specified, the duration is derived from the end date. * * @return the duration of this period in milliseconds. */ public final Dur getDuration() { if (duration == null) { return new Dur(getStart(), getEnd()); } return duration; }
/** * Updates the start and (possible) end times of this period to reflect * the specified UTC timezone status. * @param utc indicates whether the period is in UTC time */ public void setUtc(final boolean utc) { getStart().setUtc(utc); getEnd().setUtc(utc); }
/** * */ public void testGetStart() { assertEquals(expectedDate, period.getStart()); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified UTC timezone status. * @param utc indicates whether the period is in UTC time */ public void setUtc(final boolean utc) { getStart().setUtc(utc); getEnd().setUtc(utc); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified UTC timezone status. * @param utc indicates whether the period is in UTC time */ public void setUtc(final boolean utc) { getStart().setUtc(utc); getEnd().setUtc(utc); }
/** * Returns the duration of this period. If an explicit duration is not * specified, the duration is derived from the end date. * * @return the duration of this period in milliseconds. */ public final TemporalAmount getDuration() { if (duration == null) { return TemporalAmountAdapter.fromDateRange(getStart(), getEnd()).getDuration(); } return duration.getDuration(); }
/** * Returns the duration of this period. If an explicit duration is not * specified, the duration is derived from the end date. * * @return the duration of this period in milliseconds. */ public final TemporalAmount getDuration() { if (duration == null) { return TemporalAmountAdapter.fromDateRange(getStart(), getEnd()).getDuration(); } return duration.getDuration(); }