< prev index next >

src/java.xml/share/classes/javax/xml/datatype/Duration.java

Print this page




  72  * as addition, subtraction and multiplication.
  73  * Because durations don't have total order, an operation could
  74  * fail for some combinations of operations. For example, you cannot
  75  * subtract 15 days from 1 month. See the javadoc of those methods
  76  * for detailed conditions where this could happen.
  77  *
  78  * <p>Also, division of a duration by a number is not provided because
  79  * the {@code Duration} class can only deal with finite precision
  80  * decimal numbers. For example, one cannot represent 1 sec divided by 3.
  81  *
  82  * <p>However, you could substitute a division by 3 with multiplying
  83  * by numbers such as 0.3 or 0.333.
  84  *
  85  * <h2>Range of allowed values</h2>
  86  * <p>
  87  * Because some operations of {@code Duration} rely on {@link Calendar}
  88  * even though {@link Duration} can hold very large or very small values,
  89  * some of the methods may not work correctly on such {@code Duration}s.
  90  * The impacted methods document their dependency on {@link Calendar}.
  91  *
  92  * @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
  93  * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
  94  * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
  95  * @author <a href="mailto:Sunitha.Reddy@Sun.com">Sunitha Reddy</a>
  96  * @see XMLGregorianCalendar#add(Duration)
  97  * @since 1.5
  98  */
  99 public abstract class Duration {
 100 
 101     /**
 102      * Debugging {@code true} or {@code false}.
 103      */
 104     private static final boolean DEBUG = true;
 105 
 106     /**
 107      * Default no-arg constructor.
 108      *
 109      * <p>Note: Always use the {@link DatatypeFactory} to
 110      * construct an instance of {@code Duration}.
 111      * The constructor on this class cannot be guaranteed to
 112      * produce an object with a consistent state and may be
 113      * removed in the future.
 114      */
 115     public Duration() {




  72  * as addition, subtraction and multiplication.
  73  * Because durations don't have total order, an operation could
  74  * fail for some combinations of operations. For example, you cannot
  75  * subtract 15 days from 1 month. See the javadoc of those methods
  76  * for detailed conditions where this could happen.
  77  *
  78  * <p>Also, division of a duration by a number is not provided because
  79  * the {@code Duration} class can only deal with finite precision
  80  * decimal numbers. For example, one cannot represent 1 sec divided by 3.
  81  *
  82  * <p>However, you could substitute a division by 3 with multiplying
  83  * by numbers such as 0.3 or 0.333.
  84  *
  85  * <h2>Range of allowed values</h2>
  86  * <p>
  87  * Because some operations of {@code Duration} rely on {@link Calendar}
  88  * even though {@link Duration} can hold very large or very small values,
  89  * some of the methods may not work correctly on such {@code Duration}s.
  90  * The impacted methods document their dependency on {@link Calendar}.
  91  *
  92  * @author Joseph Fialli
  93  * @author Kohsuke Kawaguchi
  94  * @author Jeff Suttor
  95  * @author Sunitha Reddy
  96  * @see XMLGregorianCalendar#add(Duration)
  97  * @since 1.5
  98  */
  99 public abstract class Duration {
 100 
 101     /**
 102      * Debugging {@code true} or {@code false}.
 103      */
 104     private static final boolean DEBUG = true;
 105 
 106     /**
 107      * Default no-arg constructor.
 108      *
 109      * <p>Note: Always use the {@link DatatypeFactory} to
 110      * construct an instance of {@code Duration}.
 111      * The constructor on this class cannot be guaranteed to
 112      * produce an object with a consistent state and may be
 113      * removed in the future.
 114      */
 115     public Duration() {


< prev index next >