Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Javadoc

  • Loading branch information...
commit 5c63be412308aab7005c041b30dba0c493bec91f 1 parent f86b653
@jodastephen jodastephen authored
View
2  src/main/java/javax/time/Clock.java
@@ -101,7 +101,7 @@
* This may use {@link System#currentTimeMillis()}, or a higher resolution clock if
* one is available.
* <p>
- * Conversion from instant to date or time uses the {@link ZoneId#UTC UTC time-zone}.
+ * Conversion from instant to date or time uses the {@link ZoneOffset#UTC UTC time-zone}.
* <p>
* The returned implementation is immutable, thread-safe and {@code Serializable}.
*
View
6 src/main/java/javax/time/OffsetDateTime.java
@@ -1391,14 +1391,12 @@ public ZonedDateTime atZoneSameInstant(ZoneId zone) {
* Time-zone rules, such as daylight savings, mean that not every time on the
* local time-line exists. If the local date-time is in a gap or overlap according to
* the rules then a resolver is used to determine the resultant local time and offset.
- * This method uses the {@link ZoneResolvers#retainOffset() retain-offset} resolver.
- * This selects the date-time immediately after a gap and retains the offset in
- * overlaps where possible, selecting the earlier offset if not possible.
+ * This method uses {@link ZonedDateTime#ofLocal(LocalDateTime, ZoneId, ZoneOffset)}
+ * to retain the offset from this instance if possible.
* <p>
* Finer control over gaps and overlaps is available in two ways.
* If you simply want to use the later offset at overlaps then call
* {@link ZonedDateTime#withLaterOffsetAtOverlap()} immediately after this method.
- * Alternately, pass a specific resolver to {@link #atZoneSimilarLocal(ZoneId, ZoneResolver)}.
* <p>
* To create a zoned date-time at the same instant irrespective of the local time-line,
* use {@link #atZoneSameInstant(ZoneId)}.
View
2  src/main/java/javax/time/calendrical/DateTime.java
@@ -122,7 +122,7 @@
*
* <h4>Implementation notes</h4>
* Implementations must check and handle any fields defined in {@link ChronoField} before
- * delegating on to the {@link DateTimeField#doWith(DateTimeAccessor, long) doWith method} on the specified field.
+ * delegating on to the {@link DateTimeField#doWith(DateTime, long) doWith method} on the specified field.
* If the implementing class is immutable, then this method must return an updated copy of the original.
* If the class is mutable, then this method must update the original and return it.
*
View
6 src/main/java/javax/time/calendrical/DateTimeAccessor.java
@@ -41,9 +41,9 @@
* This interface is implemented by all date-time classes.
* It provides access to the state using the {@link #get(DateTimeField)} and
* {@link #getLong(DateTimeField)} methods that takes a {@link DateTimeField}.
- * Access is also provided to any additional state using a simple lookup by
- * {@code Class} through {@link #extract(Class)}. This is primarily
- * intended to provide access to the time-zone, offset and calendar system.
+ * Access is also provided to any additional state using a query interface
+ * through {@link #query(Query)}.
+ * This provides access to the time-zone, precision and calendar system.
* <p>
* A sub-interface, {@link DateTime}, extends this definition to one that also
* supports adjustment and manipulation on more complete date-time objects.
View
10 src/main/java/javax/time/calendrical/package.html
@@ -51,15 +51,15 @@
Dates and times are expressed in terms of fields and units.
A unit is used to measure an amount of time, such as years, days or minutes.
All units implement {@link javax.time.calendrical.PeriodUnit}.
-The set of well known units is defined in {@link javax.time.calendrical.LocalPeriodUnit},
-for example, {@link javax.time.calendrical.LocalPeriodUnit#DAYS}.
+The set of well known units is defined in {@link javax.time.calendrical.ChronoUnit},
+for example, {@link javax.time.calendrical.ChronoUnit#DAYS}.
The unit interface is designed to allow applications to add their own units.
</p>
<p>
A field is used to express part of a larger date-time, such as year, month-of-year or second-of-minute.
All fields implement {@link javax.time.calendrical.DateTimeField}.
-The set of well known fields are defined in {@link javax.time.calendrical.LocalDateTimeField},
-for example, {@link javax.time.calendrical.LocalDateTimeField#HOUR_OF_DAY}.
+The set of well known fields are defined in {@link javax.time.calendrical.ChronoField},
+for example, {@link javax.time.calendrical.ChronoField#HOUR_OF_DAY}.
An additional fields are defined by {@link javax.time.calendrical.JulianDayField}.
The field interface is designed to allow applications to add their own fields.
</p>
@@ -75,7 +75,7 @@
One use of fields in application code is to retrieve fields for which there is no convenience method.
For example, getting the day-of-month is common enough that there is a method on {@code LocalDate}
called {@code getDayOfMonth()}. However for more unusual fields it is necessary to use the field.
-For example, {@code date.get(LocalDateField.ALIGNED_WEEK_OF_MONTH)}.
+For example, {@code date.get(ChronoField.ALIGNED_WEEK_OF_MONTH)}.
The fields also provide access to the range of valid values.
</p>
View
9 src/main/java/javax/time/chrono/ChronoLocalDateTime.java
@@ -178,8 +178,8 @@ public int compare(ChronoLocalDateTime<?> datetime1, ChronoLocalDateTime<?> date
/**
* Converts this date-time to an {@code Instant}.
* <p>
- * This combines this {@link #getDateTime() local date-time} and
- * the specified offset to form an {@code Instant}.
+ * This combines this local date-time and the specified offset to form
+ * an {@code Instant}.
*
* @param offset the offset to use for the conversion, not null
* @return an {@code Instant} representing the same instant, not null
@@ -190,9 +190,8 @@ public int compare(ChronoLocalDateTime<?> datetime1, ChronoLocalDateTime<?> date
* Converts this date-time to the number of seconds from the epoch
* of 1970-01-01T00:00:00Z.
* <p>
- * This uses this {@link #getDateTime() local date-time} and
- * the specified offset to calculate the epoch-second value,
- * which is the number of elapsed seconds from 1970-01-01T00:00:00Z.
+ * This combines this local date-time and the specified offset to calculate the
+ * epoch-second value, which is the number of elapsed seconds from 1970-01-01T00:00:00Z.
* Instants on the time-line after the epoch are positive, earlier are negative.
*
* @param offset the offset to use for the conversion, not null
View
16 src/main/java/javax/time/chrono/global/package.html
@@ -61,10 +61,10 @@
<pre>
// Print the Thai Buddhist date
ChronoLocalDate&lt;ThaiBuddhistChrono&gt; now1 = ThaiBuddhistChrono.INSTANCE.now();
- int day = now1.get(LocalDateTimeField.DAY_OF_MONTH);
- int dow = now1.get(LocalDateTimeField.DAY_OF_WEEK);
- int month = now1.get(LocalDateTimeField.MONTH_OF_YEAR);
- int year = now1.get(LocalDateTimeField.YEAR);
+ int day = now1.get(ChronoField.DAY_OF_MONTH);
+ int dow = now1.get(ChronoField.DAY_OF_WEEK);
+ int month = now1.get(ChronoField.MONTH_OF_YEAR);
+ int year = now1.get(ChronoField.YEAR);
System.out.printf(" Today is %s %s %d-%s-%d%n", now1.getChrono().getId(),
dow, day, month, year);
@@ -78,11 +78,11 @@
// Print today's date and the last day of the year for the Thai Buddhist Calendar.
ChronoLocalDate&lt;ThaiBuddhistChrono&gt; first = now1
- .with(LocalDateTimeField.DAY_OF_MONTH, 1)
- .with(LocalDateTimeField.MONTH_OF_YEAR, 1);
+ .with(ChronoField.DAY_OF_MONTH, 1)
+ .with(ChronoField.MONTH_OF_YEAR, 1);
ChronoLocalDate&lt;ThaiBuddhistChrono&gt; last = first
- .plus(1, LocalPeriodUnit.YEARS)
- .minus(1, LocalPeriodUnit.DAYS);
+ .plus(1, ChronoUnit.YEARS)
+ .minus(1, ChronoUnit.DAYS);
System.out.printf(" %s: 1st of year: %s; end of year: %s%n", last.getChrono().getId(),
first, last);
View
10 src/main/java/javax/time/zone/ZoneRules.java
@@ -47,13 +47,11 @@
* {@link ZoneOffsetTransitionRule} is used for future transitions that are based
* on the result of an algorithm.
* <p>
- * The rules are loaded via {@link ZoneId} and {@link ZoneRulesGroup} and
- * are specific to a group, region and version. The same rules may be shared
- * between multiple versions, regions or even groups.
+ * The rules are loaded via {@link ZoneRulesProvider} using a {@link ZoneId}.
+ * The same rules may be shared internally between multiple zone IDs.
* <p>
- * Serializing an instance of {@code ZoneRules} will store the entire set
- * of rules. It does not store the group, region or version as they are not
- * part of the state of this object.
+ * Serializing an instance of {@code ZoneRules} will store the entire set of rules.
+ * It does not store the zone ID as it is not part of the state of this object.
* <p>
* A rule implementation may or may not store full information about historic
* and future transitions, and the information stored is only as accurate as
View
11 src/main/java/javax/time/zone/ZoneRulesProvider.java
@@ -252,7 +252,7 @@ protected ZoneRulesProvider() {
//-----------------------------------------------------------------------
/**
- * Gets the set of available zone IDs.
+ * SPI method to get the available zone IDs.
* <p>
* This obtains the IDs that this {@code ZoneRulesProvider} provides.
* A provider should provide data for at least one region.
@@ -265,7 +265,7 @@ protected ZoneRulesProvider() {
protected abstract Set<String> provideZoneIds();
/**
- * Returns a resolved provider bound to the specified zone ID.
+ * SPI method to bind to the specified zone ID.
* <p>
* {@code ZoneRulesProvider} has a lookup from zone ID to provider.
* This method is used when building that lookup, allowing providers
@@ -288,20 +288,19 @@ protected ZoneRulesProvider provideBind(String zoneId) {
}
/**
- * Gets rules for the zone ID.
+ * SPI method to get the rules for the zone ID.
* <p>
* This loads the rules for the region and version specified.
* The version may be null to indicate the "latest" version.
*
* @param regionId the time-zone region ID, not null
- * @param versionId the time-zone version ID, null means "latest"
* @return the rules, not null
* @throws DateTimeException if rules cannot be obtained
*/
protected abstract ZoneRules provideRules(String regionId);
/**
- * Gets the history of rules for the zone ID.
+ * SPI method to get the history of rules for the zone ID.
* <p>
* This returns a map of historical rules keyed by a version string.
* The exact meaning and format of the version is provider specific.
@@ -326,7 +325,7 @@ protected ZoneRulesProvider provideBind(String zoneId) {
protected abstract NavigableMap<String, ZoneRules> provideVersions(String zoneId);
/**
- * Refreshes the rules from the underlying data provider.
+ * SPI method to refresh the rules from the underlying data provider.
* <p>
* This method provides the opportunity for a provider to dynamically
* recheck the underlying data provider to find the latest rules.
Please sign in to comment.
Something went wrong with that request. Please try again.