|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omg.dds.core.Time
@Extensibility(value=FINAL_EXTENSIBILITY) @Nested public abstract class Time
A moment in time expressed with nanosecond precision (though not necessarily nanosecond accuracy).
| Constructor Summary | |
|---|---|
Time()
|
|
| Method Summary | |
|---|---|
abstract Time |
clone()
Extends the concept of "cloneable" defined in java.lang by
providing an explicit public Value.clone() method. |
abstract long |
getRemainder(java.util.concurrent.TimeUnit primaryUnit,
java.util.concurrent.TimeUnit remainderUnit)
If getting the magnitude of this time 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. |
abstract long |
getTime(java.util.concurrent.TimeUnit inThisUnit)
Truncate this time to a whole-number quantity of the given time unit. |
static Time |
invalidTime(Bootstrap bootstrap)
|
abstract boolean |
isValid()
|
static ModifiableTime |
newTime(long time,
java.util.concurrent.TimeUnit units,
Bootstrap bootstrap)
Construct a specific instant in time. |
| 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 Time()
| Method Detail |
|---|
public static ModifiableTime newTime(long time,
java.util.concurrent.TimeUnit units,
Bootstrap bootstrap)
t such that:
t.isValid() == false
bootstrap - Identifies the Service instance to which the new
object will belong.isValid()public static Time invalidTime(Bootstrap bootstrap)
bootstrap - Identifies the Service instance to which the
object will belong.
Time that is not valid.public abstract long getTime(java.util.concurrent.TimeUnit inThisUnit)
TimeUnit.SECONDS will result in the value
1.
If this time is invalid, this method shall return
a negative value, regardless of the units given.
If this time 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 time
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 time is equal to one second plus 100 nanoseconds since the
start of the epoch, 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 - getTime(primaryUnit)).getTime(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 time 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.getTime(TimeUnit),
Long.MAX_VALUE,
TimeUnitpublic abstract boolean isValid()
public abstract Time clone()
Valuejava.lang by
providing an explicit public Value.clone() method.
clone in interface Value<Time,ModifiableTime>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.