/** * Constructs a citation date initialized to the given date. * * @param date the reference date for the cited resource. * @param dateType the event used for reference date. */ public DefaultCitationDate(final Date date, final DateType dateType) { this.date = toMilliseconds(date); this.dateType = dateType; }
/** * Constructs a citation date initialized to the given date. * * @param date the reference date for the cited resource. * @param dateType the event used for reference date. */ public DefaultCitationDate(final Date date, final DateType dateType) { this.date = toMilliseconds(date); this.dateType = dateType; }
/** * Sets the reference date for the cited resource. * * @param newValue the new date. */ public void setDate(final Date newValue) { checkWritePermission(); date = toMilliseconds(newValue); }
/** * Sets the date and time of the first use. * * @param newValue the new usage date. */ public void setUsageDate(final Date newValue) { checkWritePermission(); usageDate = toMilliseconds(newValue); }
/** * Sets the date of the edition. * * @param newValue the new edition date, or {@code null} if none. */ public void setEditionDate(final Date newValue) { checkWritePermission(); editionDate = toMilliseconds(newValue); }
/** * Sets the time the event occurred. * * @param newValue the new time value. */ public void setTime(final Date newValue) { checkWritePermission(); time = toMilliseconds(newValue); }
/** * Sets the preferred date and time of collection. * * @param newValue the new requested date of collection value. */ public void setRequestedDateOfCollection(final Date newValue) { checkWritePermission(); requestedDateOfCollection = toMilliseconds(newValue); }
/** * Sets the latest date and time collection must be completed. * * @param newValue the new latest acceptable data value. */ public void setLatestAcceptableDate(final Date newValue) { checkWritePermission(); latestAcceptableDate = toMilliseconds(newValue); } }
/** * Sets the date and time after which collection is no longer valid. * * @param newValue the new expiry date. */ public void setExpiryDate(final Date newValue) { checkWritePermission(); expiryDate = toMilliseconds(newValue); }
/** * Sets the date and time when the dataset will be available. * * @param newValue the new planned available time. */ public void setPlannedAvailableDateTime(final Date newValue) { checkWritePermission(); plannedAvailableDateTime = toMilliseconds(newValue); }
/** * Sets the date and time or range of date and time on or over which the process step occurred. * * @param newValue the new date. */ public void setDate(final Date newValue) { checkWritePermission(); date = toMilliseconds(newValue); }
/** * Sets the time the event occurred. * * @param newValue the new time value. */ public void setTime(final Date newValue) { checkWritePermission(time); time = toMilliseconds(newValue); }
/** * Creates a new datum with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param datum the datum to copy. * * @see #castOrCopy(TemporalDatum) */ protected DefaultTemporalDatum(final TemporalDatum datum) { super(datum); origin = MetadataUtilities.toMilliseconds(datum.getOrigin()); }
/** * Sets the date and time when the dataset will be available. * * @param newValue the new planned available time. */ public void setPlannedAvailableDateTime(final Date newValue) { checkWritePermission(plannedAvailableDateTime); plannedAvailableDateTime = toMilliseconds(newValue); }
/** * Sets the date and time after which collection is no longer valid. * * @param newValue the new expiry date. */ public void setExpiryDate(final Date newValue) { checkWritePermission(toDate(expiryDate)); expiryDate = toMilliseconds(newValue); }
/** * Sets the date and time of the first use. * * @param newValue the new usage date. */ public void setUsageDate(final Date newValue) { checkWritePermission(toDate(usageDate)); usageDate = toMilliseconds(newValue); }
/** * Sets the date of the edition. * * @param newValue the new edition date, or {@code null} if none. */ public void setEditionDate(final Date newValue) { checkWritePermission(toDate(editionDate)); editionDate = toMilliseconds(newValue); }
/** * Sets the reference date for the cited resource. * * @param newValue the new date. */ public void setDate(final Date newValue) { checkWritePermission(toDate(date)); date = toMilliseconds(newValue); }
/** * Sets the latest date and time collection must be completed. * * @param newValue the new latest acceptable data value. */ public void setLatestAcceptableDate(final Date newValue) { checkWritePermission(toDate(latestAcceptableDate)); latestAcceptableDate = toMilliseconds(newValue); } }
/** * Tests {@link MetadataUtilities#toMilliseconds(Date)}. */ @Test public void testToMilliseconds() { assertEquals(1000, MetadataUtilities.toMilliseconds(new Date(1000))); assertEquals(Long.MIN_VALUE, MetadataUtilities.toMilliseconds(null)); }