Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Javadoc

See #160
  • Loading branch information...
commit 3186fc0253912315d10e1010762b3fccd959bb3c 1 parent 0491d49
Stephen Colebourne jodastephen authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/main/java/javax/time/Duration.java
7 src/main/java/javax/time/Duration.java
View
@@ -45,6 +45,7 @@
import java.math.RoundingMode;
import java.util.Objects;
+import javax.time.calendrical.ChronoField;
import javax.time.calendrical.ChronoUnit;
import javax.time.calendrical.DateTime;
import javax.time.calendrical.DateTime.MinusAdjuster;
@@ -760,6 +761,9 @@ public Duration abs() {
* This method is not intended to be called by application code directly.
* Applications should use the {@code plus(PlusAdjuster)} method
* on the date-time object passing this duration as the argument.
+ * <p>
+ * A {@code Duration} can only be added to a {@code DateTime} that
+ * represents an instant and can supply {@link ChronoField#INSTANT_SECONDS}.
*
* @param dateTime the date-time object to adjust, not null
* @return an object of the same type with the adjustment made, not null
@@ -783,6 +787,9 @@ public DateTime doPlusAdjustment(DateTime dateTime) {
* This method is not intended to be called by application code directly.
* Applications should use the {@code minus(MinusAdjuster)} method
* on the date-time object passing this duration as the argument.
+ * <p>
+ * A {@code Duration} can only be subtracted from a {@code DateTime} that
+ * represents an instant and can supply {@link ChronoField#INSTANT_SECONDS}.
*
* @param dateTime the date-time object to adjust, not null
* @return an object of the same type with the adjustment made, not null
Please sign in to comment.
Something went wrong with that request. Please try again.