|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omg.dds.core.Duration
@Extensibility(value=FINAL_EXTENSIBILITY) @Nested public abstract class Duration
A span of elapsed time expressed with nanosecond precision.
| Constructor Summary | |
|---|---|
Duration()
|
|
| Method Summary | |
|---|---|
abstract Duration |
clone()
Extends the concept of "cloneable" defined in java.lang by
providing an explicit public Value.clone() method. |
abstract long |
getDuration(java.util.concurrent.TimeUnit inThisUnit)
Truncate this duration to a whole-number quantity of the given time unit. |
abstract long |
getRemainder(java.util.concurrent.TimeUnit primaryUnit,
java.util.concurrent.TimeUnit remainderUnit)
If getting the magnitude of this duration in the given primaryUnit would cause truncation with respect to the
given remainderUnit, return the magnitude of the
truncation in the latter (presumably finer-grained) unit. |
static Duration |
infiniteDuration(Bootstrap bootstrap)
|
abstract boolean |
isInfinite()
Report whether this duration lasts forever. |
abstract boolean |
isZero()
Report whether this duration lasts no time at all. |
static ModifiableDuration |
newDuration(long duration,
java.util.concurrent.TimeUnit unit,
Bootstrap bootstrap)
Construct a time duration of the given magnitude. |
static Duration |
zeroDuration(Bootstrap bootstrap)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.omg.dds.core.Value |
|---|
equals, hashCode, modify |
| Methods inherited from interface org.omg.dds.core.DDSObject |
|---|
getBootstrap |
| Constructor Detail |
|---|
public Duration()
| Method Detail |
|---|
public static ModifiableDuration newDuration(long duration,
java.util.concurrent.TimeUnit unit,
Bootstrap bootstrap)
Long.MAX_VALUE indicates an infinite
duration, regardless of the units specified.
bootstrap - Identifies the Service instance to which the new
object will belong.isInfinite(),
infiniteDuration(Bootstrap)public static Duration infiniteDuration(Bootstrap bootstrap)
bootstrap - Identifies the Service instance to which the
object will belong.
Duration of infinite length.public static Duration zeroDuration(Bootstrap bootstrap)
bootstrap - Identifies the Service instance to which the
object will belong.
Duration of zero length.public abstract long getDuration(java.util.concurrent.TimeUnit inThisUnit)
TimeUnit.SECONDS will result in the value 1.
If this duration is infinite, this method shall return
Long.MAX_VALUE, regardless of the units given.
If this duration cannot be expressed in the given units without
overflowing, this method shall return Long.MAX_VALUE. In such
a case, the caller may wish to use this method in combination with
getRemainder(TimeUnit, TimeUnit) to obtain the full duration
without lack of precision.
inThisUnit - The time unit in which the return result will
be measured.getRemainder(TimeUnit, TimeUnit),
Long.MAX_VALUE,
TimeUnit
public abstract long getRemainder(java.util.concurrent.TimeUnit primaryUnit,
java.util.concurrent.TimeUnit remainderUnit)
primaryUnit would cause truncation with respect to the
given remainderUnit, return the magnitude of the
truncation in the latter (presumably finer-grained) unit. For example,
if this duration is equal to one second plus 100 nanoseconds, calling
this method with arguments of TimeUnit.SECONDS and
TimeUnit.NANOSECONDS respectively will result in the value
100.
This method is equivalent to the following pseudo-code:
(this - getDuration(primaryUnit)).getDuration(remainderUnit)
If remainderUnit is represents a coarser granularity than
primaryUnit (for example, the former is
TimeUnit.HOURS but the latter is TimeUnit.SECONDS),
this method shall return 0.
If the resulting duration cannot be expressed in the given units
without overflowing, this method shall return Long.MAX_VALUE.
primaryUnit - remainderUnit - The time unit in which the return result will
be measured.getDuration(TimeUnit),
Long.MAX_VALUE,
TimeUnitpublic abstract boolean isZero()
this.getDuration(TimeUnit.NANOSECONDS) == 0;
getDuration(TimeUnit)public abstract boolean isInfinite()
this.equals(infiniteDuration(this.getBootstrap()))
infiniteDuration(Bootstrap)public abstract Duration clone()
Valuejava.lang by
providing an explicit public Value.clone() method.
clone in interface Value<Duration,ModifiableDuration>clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2010 Real-Time Innovations, Inc. (RTI)
Copyright © 2010 PrismTech, Ltd.
Copyright © 2010 Object Management Group, Inc. (OMG)
All Rights Reserved.