Lines Matching refs:duration

40  * A negative sign indicates a negative duration.</p>
43 * to use for the duration datatype of XML Schema 1.0 with
52 * <li>A==B (A and B are of the same duration)
57 * The {@link #compare(Duration duration)} method implements this
71 * <p>Also, division of a duration by a number is not provided because
209 * Returns the sign of this duration in -1,0, or 1.
212 * -1 if this duration is negative, 0 if the duration is zero,
213 * and 1 if the duration is positive.
303 * <p>Returns the length of the duration in milliseconds.</p>
323 * <code>startInstant+duration</code>
340 * <p>Returns the length of the duration in milliseconds.</p>
360 * <code>startInstant+duration</code>.
380 * Fields of a duration object may contain arbitrary large value.
423 * A field of a duration object may or may not be present.
438 * <p>Computes a new duration whose value is <code>this+rhs</code>.</p>
490 * Adds this duration to a {@link Calendar} object.
502 * Also, since this duration class is a Gregorian duration, this
510 * this duration is "P1.23456S", then 1 is added to SECONDS,
531 * Adds this duration to a {@link Date} object.
535 * a {@link java.util.GregorianCalendar}, then the duration
544 * determine the duration of months and years.
565 * <p>Computes a new duration whose value is <code>this-rhs</code>.</p>
618 * <p>Computes a new duration whose value is <code>factor</code> times
619 * longer than the value of this duration.</p>
638 * Computes a new duration whose value is <code>factor</code> times
639 * longer than the value of this duration.
704 * <p>For example, duration of one month normalizes to 31 days
715 * fields of this duration object is used to construct a new
721 * an unexpected result if this duration object holds
736 * <a href="http://www.w3.org/TR/xmlschema-2/#duration-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.6.2,
737 * <i>Order relation on duration</i></a>.</p>
741 * <li>{@link DatatypeConstants#LESSER} if this <code>Duration</code> is shorter than <code>duration</code> parameter</li>
742 * <li>{@link DatatypeConstants#EQUAL} if this <code>Duration</code> is equal to <code>duration</code> parameter</li>
743 * <li>{@link DatatypeConstants#GREATER} if this <code>Duration</code> is longer than <code>duration</code> parameter</li>
747 * @param duration to compare
749 * @return the relationship between <code>this</code> <code>Duration</code>and <code>duration</code> parameter as
757 * @throws NullPointerException if <code>duration</code> is <code>null</code>.
762 public abstract int compare(final Duration duration);
765 * <p>Checks if this duration object is strictly longer than
775 * @param duration <code>Duration</code> to test this <code>Duration</code> against.
781 * @throws NullPointerException If <code>duration</code> is null.
784 * true if the duration represented by this object
785 * is longer than the given duration. false otherwise.
788 * @see #compare(Duration duration)
790 public boolean isLongerThan(final Duration duration) {
791 return compare(duration) == DatatypeConstants.GREATER;
795 * <p>Checks if this duration object is strictly shorter than
798 * @param duration <code>Duration</code> to test this <code>Duration</code> against.
800 * @return <code>true</code> if <code>duration</code> parameter is shorter than this <code>Duration</code>,
807 * @throws NullPointerException if <code>duration</code> is null.
809 * @see #isLongerThan(Duration duration)
810 * @see #compare(Duration duration)
812 public boolean isShorterThan(final Duration duration) {
813 return compare(duration) == DatatypeConstants.LESSER;
817 * <p>Checks if this duration object has the same duration
836 * @param duration
840 * <code>true</code> if this duration is the same length as
841 * <code>duration</code>.
842 * <code>false</code> if <code>duration</code> is not a
844 * or its length is different from this duration.
851 * @see #compare(Duration duration)
853 public boolean equals(final Object duration) {
854 if (duration == this) {
857 if (duration instanceof Duration) {
858 return compare((Duration) duration) == DatatypeConstants.EQUAL;