<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_141) on Mon Oct 30 09:22:24 GMT 2017 --> <title>Duration (JavaFX 8)</title> <meta name="date" content="2017-10-30"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Duration (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":42,"i4":10,"i5":10,"i6":10,"i7":10,"i8":9,"i9":10,"i10":10,"i11":10,"i12":10,"i13":9,"i14":9,"i15":10,"i16":42,"i17":10,"i18":9,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Duration.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../javafx/util/Callback.html" title="interface in javafx.util"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../javafx/util/Pair.html" title="class in javafx.util"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?javafx/util/Duration.html" target="_top">Frames</a></li> <li><a href="Duration.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javafx.util</div> <h2 title="Class Duration" class="title">Class Duration</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>javafx.util.Duration</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable, java.lang.Comparable<<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">Duration</span> extends java.lang.Object implements java.lang.Comparable<<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>>, java.io.Serializable</pre> <div class="block"><p> A class that defines a duration of time. Duration instances are immutable, and are therefore replaced rather than modified, similar to <code>BigDecimal</code>. Duration's can be created using the constructor, or one of the static construction methods such as <a href="../../javafx/util/Duration.html#seconds-double-"><code>seconds(double)</code></a> or <a href="../../javafx/util/Duration.html#minutes-double-"><code>minutes(double)</code></a>. </p></div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.0</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../serialized-form.html#javafx.util.Duration">Serialized Form</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#INDEFINITE">INDEFINITE</a></span></code> <div class="block">An Infinite Duration.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#ONE">ONE</a></span></code> <div class="block">A Duration of 1 millisecond.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#UNKNOWN">UNKNOWN</a></span></code> <div class="block">A Duration of some unknown amount of time.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#ZERO">ZERO</a></span></code> <div class="block">A Duration of 0 (no time).</div> </td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#Duration-double-">Duration</a></span>(double millis)</code> <div class="block">Creates a new Duration with potentially fractional millisecond resolution.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#add-javafx.util.Duration-">add</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block">Add this instance and another Duration instance to return a new Duration instance.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#compareTo-javafx.util.Duration-">compareTo</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> d)</code> <div class="block">Compares durations represented by this object and the specified object.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#divide-double-">divide</a></span>(double n)</code> <div class="block">Divide this instance by a number to return a new Duration instance.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#divide-javafx.util.Duration-">divide</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <div class="block"><span class="deprecationComment">This method produces surprising results by not taking units into account. Use <a href="../../javafx/util/Duration.html#divide-double-"><code>divide(double)</code></a> instead.</span></div> </div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object obj)</code> <div class="block">Indicates whether some other object is "equal to" this one.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#greaterThan-javafx.util.Duration-">greaterThan</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block">Returns true if the specified duration is greater than (>) this instance.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#greaterThanOrEqualTo-javafx.util.Duration-">greaterThanOrEqualTo</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block">Returns true if the specified duration is greater than or equal to (>=) this instance.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#hashCode--">hashCode</a></span>()</code> <div class="block">Returns a hash code for this <code>Duration</code> object.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#hours-double-">hours</a></span>(double h)</code> <div class="block">Factory method that returns a Duration instance representing the specified number of hours.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#isIndefinite--">isIndefinite</a></span>()</code> <div class="block">Gets whether this Duration instance is Indefinite.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#isUnknown--">isUnknown</a></span>()</code> <div class="block">Gets whether this Duration instance is Unknown.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#lessThan-javafx.util.Duration-">lessThan</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block">Returns true if the specified duration is less than (<) this instance.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#lessThanOrEqualTo-javafx.util.Duration-">lessThanOrEqualTo</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block">Returns true if the specified duration is less than or equal to (<=) this instance.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#millis-double-">millis</a></span>(double ms)</code> <div class="block">Factory method that returns a Duration instance for a specified number of milliseconds.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#minutes-double-">minutes</a></span>(double m)</code> <div class="block">Factory method that returns a Duration instance representing the specified number of minutes.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#multiply-double-">multiply</a></span>(double n)</code> <div class="block">Multiply this instance with a number representing millis and return a new Duration.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#multiply-javafx.util.Duration-">multiply</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <div class="block"><span class="deprecationComment">This method produces surprising results by not taking units into account. Use <a href="../../javafx/util/Duration.html#multiply-double-"><code>multiply(double)</code></a> instead.</span></div> </div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#negate--">negate</a></span>()</code> <div class="block">Return a new Duration instance which has a negative number of milliseconds from this instance.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#seconds-double-">seconds</a></span>(double s)</code> <div class="block">Factory method that returns a Duration instance representing the specified number of seconds.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code><a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#subtract-javafx.util.Duration-">subtract</a></span>(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</code> <div class="block">Subtract other Duration instance from this instance to return a new Duration instance.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#toHours--">toHours</a></span>()</code> <div class="block">Returns the number of hours in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#toMillis--">toMillis</a></span>()</code> <div class="block">Returns the number of milliseconds in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#toMinutes--">toMinutes</a></span>()</code> <div class="block">Returns the number of minutes in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#toSeconds--">toSeconds</a></span>()</code> <div class="block">Returns the number of seconds in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#toString--">toString</a></span>()</code> <div class="block">Returns a string representation of this <code>Duration</code> object.</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code>static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../javafx/util/Duration.html#valueOf-java.lang.String-">valueOf</a></span>(java.lang.String time)</code> <div class="block">Factory method that returns a Duration instance for a specified amount of time.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="ZERO"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ZERO</h4> <pre>public static final <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> ZERO</pre> <div class="block">A Duration of 0 (no time).</div> </li> </ul> <a name="ONE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ONE</h4> <pre>public static final <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> ONE</pre> <div class="block">A Duration of 1 millisecond.</div> </li> </ul> <a name="INDEFINITE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>INDEFINITE</h4> <pre>public static final <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> INDEFINITE</pre> <div class="block">An Infinite Duration.</div> </li> </ul> <a name="UNKNOWN"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>UNKNOWN</h4> <pre>public static final <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> UNKNOWN</pre> <div class="block">A Duration of some unknown amount of time.</div> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="Duration-double-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>Duration</h4> <pre>public Duration(double millis)</pre> <div class="block">Creates a new Duration with potentially fractional millisecond resolution.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>millis</code> - The number of milliseconds</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="valueOf-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>valueOf</h4> <pre>public static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> valueOf(java.lang.String time)</pre> <div class="block">Factory method that returns a Duration instance for a specified amount of time. The syntax is "[number][ms|s|m|h]".</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>time</code> - A non-null string properly formatted. Leading or trailing spaces will not parse correctly. Throws a NullPointerException if time is null.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a Duration which is represented by the <code>time</code></dd> </dl> </li> </ul> <a name="millis-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>millis</h4> <pre>public static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> millis(double ms)</pre> <div class="block">Factory method that returns a Duration instance for a specified number of milliseconds.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>ms</code> - the number of milliseconds</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a Duration instance of the specified number of milliseconds</dd> </dl> </li> </ul> <a name="seconds-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>seconds</h4> <pre>public static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> seconds(double s)</pre> <div class="block">Factory method that returns a Duration instance representing the specified number of seconds.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>s</code> - the number of seconds</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a Duration instance of the specified number of seconds</dd> </dl> </li> </ul> <a name="minutes-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>minutes</h4> <pre>public static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> minutes(double m)</pre> <div class="block">Factory method that returns a Duration instance representing the specified number of minutes.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>m</code> - the number of minutes</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a Duration instance of the specified number of minutes</dd> </dl> </li> </ul> <a name="hours-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hours</h4> <pre>public static <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> hours(double h)</pre> <div class="block">Factory method that returns a Duration instance representing the specified number of hours.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>h</code> - the number of hours</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a Duration instance representing the specified number of hours</dd> </dl> </li> </ul> <a name="toMillis--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toMillis</h4> <pre>public double toMillis()</pre> <div class="block">Returns the number of milliseconds in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the Duration in fractional milliseconds</dd> </dl> </li> </ul> <a name="toSeconds--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toSeconds</h4> <pre>public double toSeconds()</pre> <div class="block">Returns the number of seconds in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the Duration in fractional seconds</dd> </dl> </li> </ul> <a name="toMinutes--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toMinutes</h4> <pre>public double toMinutes()</pre> <div class="block">Returns the number of minutes in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the Duration in fractional minutes</dd> </dl> </li> </ul> <a name="toHours--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toHours</h4> <pre>public double toHours()</pre> <div class="block">Returns the number of hours in this period or Double.POSITIVE_INFINITY if the period is INDEFINITE or NaN if the period is UNKNOWN.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the Duration in fractional hours</dd> </dl> </li> </ul> <a name="add-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>add</h4> <pre>public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> add(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block">Add this instance and another Duration instance to return a new Duration instance. If either instance is INDEFINITE, return INDEFINITE. If either instance is UNKNOWN, return UNKNOWN. This method does not change the value of the called Duration instance.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - must not be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of adding this duration to the other duration. This is the same as millis + other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="subtract-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>subtract</h4> <pre>public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> subtract(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block">Subtract other Duration instance from this instance to return a new Duration instance. If either instance is UNKNOWN, return UNKNOWN. Otherwise, if either instance is INDEFINITE, return INDEFINITE. This method does not change the value of the called Duration instance.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - must not be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of subtracting the other duration from this duration. This is the same as millis - other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="multiply-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>multiply</h4> <pre>@Deprecated public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> multiply(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">This method produces surprising results by not taking units into account. Use <a href="../../javafx/util/Duration.html#multiply-double-"><code>multiply(double)</code></a> instead.</span></div> <div class="block">Multiply this instance with a number to return a new Duration instance. If either instance is INDEFINITE, return INDEFINITE. If either Duration instance is UNKNOWN, return UNKNOWN. This method does not change the value of the called Duration instance.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - must not be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of multiplying this duration with the other duration. This is the same as millis * other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="multiply-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>multiply</h4> <pre>public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> multiply(double n)</pre> <div class="block">Multiply this instance with a number representing millis and return a new Duration. If the called Duration instance is INDEFINITE, return INDEFINITE. If the called Duration instance is UNKNOWN, return UNKNOWN. This method does not change the value of the called Duration instance.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>n</code> - the amount to multiply by in fractional milliseconds</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of multiplying this duration with n. This is the same as millis * n using double arithmetic</dd> </dl> </li> </ul> <a name="divide-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>divide</h4> <pre>public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> divide(double n)</pre> <div class="block">Divide this instance by a number to return a new Duration instance. If the called Duration instance is INDEFINITE, return INDEFINITE. If the called Duration instance is UNKNOWN, return UNKNOWN. This method does not change the value of the called Duration instance.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>n</code> - the amount to divide by in fractional milliseconds</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of dividing this duration with n. This is the same as millis / n using double arithmetic</dd> </dl> </li> </ul> <a name="divide-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>divide</h4> <pre>@Deprecated public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> divide(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">This method produces surprising results by not taking units into account. Use <a href="../../javafx/util/Duration.html#divide-double-"><code>divide(double)</code></a> instead.</span></div> <div class="block">Divide this instance by another Duration to return the ratio. If both instances are INDEFINITE, return NaN. If this instance is INDEFINITE, return POSITIVE_INFINITY If the other instance is INDEFINITE, return 0.0. This function does not change the value of the called Duration instance.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - must not be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of dividing this duration by the other duration. This is the same as millis / other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="negate--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>negate</h4> <pre>public <a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> negate()</pre> <div class="block">Return a new Duration instance which has a negative number of milliseconds from this instance. For example, <code>Duration.millis(50).negate()</code> returns a Duration of -50 milliseconds. If the called Duration instance is INDEFINITE, return INDEFINITE. This function does not change the value of the called Duration instance.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the result of negating this duration. This is the same as -millis using double arithmetic</dd> </dl> </li> </ul> <a name="isIndefinite--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isIndefinite</h4> <pre>public boolean isIndefinite()</pre> <div class="block">Gets whether this Duration instance is Indefinite. A Duration is Indefinite if it equals Duration.INDEFINITE.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if this Duration is equivalent to Duration.INDEFINITE or Double.POSITIVE_INFINITY.</dd> </dl> </li> </ul> <a name="isUnknown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isUnknown</h4> <pre>public boolean isUnknown()</pre> <div class="block">Gets whether this Duration instance is Unknown. A Duration is Unknown if it equals Duration.UNKNOWN.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if this Duration is equivalent to Duration.UNKNOWN or Double.isNaN(millis)</dd> </dl> </li> </ul> <a name="lessThan-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>lessThan</h4> <pre>public boolean lessThan(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block">Returns true if the specified duration is less than (<) this instance. INDEFINITE is treated as if it were positive infinity.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - cannot be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if millis < other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="lessThanOrEqualTo-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>lessThanOrEqualTo</h4> <pre>public boolean lessThanOrEqualTo(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block">Returns true if the specified duration is less than or equal to (<=) this instance. INDEFINITE is treated as if it were positive infinity.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - cannot be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if millis <= other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="greaterThan-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>greaterThan</h4> <pre>public boolean greaterThan(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block">Returns true if the specified duration is greater than (>) this instance. INDEFINITE is treated as if it were positive infinity.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - cannot be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if millis > other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="greaterThanOrEqualTo-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>greaterThanOrEqualTo</h4> <pre>public boolean greaterThanOrEqualTo(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> other)</pre> <div class="block">Returns true if the specified duration is greater than or equal to (>=) this instance. INDEFINITE is treated as if it were positive infinity.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>other</code> - cannot be null</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if millis >= other.millis using double arithmetic</dd> </dl> </li> </ul> <a name="toString--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public java.lang.String toString()</pre> <div class="block">Returns a string representation of this <code>Duration</code> object.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>toString</code> in class <code>java.lang.Object</code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a string representation of this <code>Duration</code> object.</dd> </dl> </li> </ul> <a name="compareTo-javafx.util.Duration-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>compareTo</h4> <pre>public int compareTo(<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a> d)</pre> <div class="block">Compares durations represented by this object and the specified object. Returns a negative integer, zero, or a positive integer as this duration is less than, equal to, or greater than the specified duration.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>compareTo</code> in interface <code>java.lang.Comparable<<a href="../../javafx/util/Duration.html" title="class in javafx.util">Duration</a>></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>d</code> - the duration to be compared.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a negative integer, zero, or a positive integer as this duration is less than, equal to, or greater than the specified duration.</dd> </dl> </li> </ul> <a name="equals-java.lang.Object-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>equals</h4> <pre>public boolean equals(java.lang.Object obj)</pre> <div class="block">Indicates whether some other object is "equal to" this one.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>equals</code> in class <code>java.lang.Object</code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>obj</code> - the reference object with which to compare.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if this object is equal to the <code>obj</code> argument; <code>false</code> otherwise.</dd> </dl> </li> </ul> <a name="hashCode--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>hashCode</h4> <pre>public int hashCode()</pre> <div class="block">Returns a hash code for this <code>Duration</code> object.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>hashCode</code> in class <code>java.lang.Object</code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a hash code for this <code>Duration</code> object.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Duration.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../javafx/util/Callback.html" title="interface in javafx.util"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../javafx/util/Pair.html" title="class in javafx.util"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?javafx/util/Duration.html" target="_top">Frames</a></li> <li><a href="Duration.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"><a href="http://bugreport.java.com/bugreport/" target="_blank">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="https://docs.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html" target="_blank">Copyright</a> © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to <a href="http://download.oracle.com/otndocs/jcp/java_se-8-mrel-spec/license.html" target="_blank">license terms</a>. Also see the <a target="_blank" href="http://www.oracle.com/technetwork/java/redist-137594.html" target="_blank">documentation redistribution policy</a>.</font></small></p> </body> </html>