/** * Creates an instant for the given date. * * @param time the date for which to create instant, or {@code null}. * @return the instant, or {@code null} if the given time was null. * @throws UnsupportedOperationException if the temporal factory is not available on the classpath. */ public static Instant createInstant(final Date time) throws UnsupportedOperationException { return (time != null) ? createInstant(getTemporalFactory(), time) : null; }
/** * Creates an instant for the given date. * * @param time the date for which to create instant, or {@code null}. * @return the instant, or {@code null} if the given time was null. * @throws UnsupportedOperationException if the temporal factory is not available on the classpath. */ public static Instant createInstant(final Date time) throws UnsupportedOperationException { return (time != null) ? createInstant(getTemporalFactory(), time) : null; }
/** * Creates a period for the given begin and end dates. The given arguments can be null if the * {@link TemporalFactory#createInstant(Date)} method accepts null dates, which stand for * undetermined position. * * @param begin the begin date, inclusive. * @param end the end date, inclusive. * @return the period. * @throws UnsupportedOperationException if the temporal factory is not available on the classpath. */ public static Period createPeriod(final Date begin, final Date end) throws UnsupportedOperationException { final TemporalFactory factory = getTemporalFactory(); return factory.createPeriod(createInstant(factory, begin), createInstant(factory, end)); }
/** * Creates a period for the given begin and end dates. The given arguments can be null if the * {@link TemporalFactory#createInstant(Date)} method accepts null dates, which stand for * undetermined position. * * @param begin the begin date, inclusive. * @param end the end date, inclusive. * @return the period. * @throws UnsupportedOperationException if the temporal factory is not available on the classpath. */ public static Period createPeriod(final Date begin, final Date end) throws UnsupportedOperationException { final TemporalFactory factory = getTemporalFactory(); return factory.createPeriod(createInstant(factory, begin), createInstant(factory, end)); } }
final TemporalFactory factory = TemporalUtilities.getTemporalFactory(); InternationalString years = null; int value;
final TemporalFactory factory = TemporalUtilities.getTemporalFactory(); InternationalString years = null; int value;