@SCJAllowed public class AbsoluteTime extends HighResolutionTime
java.util.Date class. AbsoluteTime time in subtract is null,
an IllegalArgumentException is thrown. AbsoluteTime subtract,
an IllegalArgumentException is thrown.| Constructor and Description |
|---|
AbsoluteTime()
Equivalent to
new AbsoluteTime(0,0). |
AbsoluteTime(AbsoluteTime time)
Make a new
AbsoluteTime object from the given AbsoluteTime object. |
AbsoluteTime(Clock clock)
Equivalent to
AbsoluteTime(0,0,clock). |
AbsoluteTime(long millis,
int nanos)
Constructs an
AbsoluteTime object with millisecond and
nanosecond components past the real-time clock's Epoch. |
AbsoluteTime(long millis,
int nanos,
Clock clock)
Constructs an
AbsoluteTime object with time millisecond
and nanosecond components past the clock's Epoch. |
| Modifier and Type | Method and Description |
|---|---|
AbsoluteTime |
add(long millis,
int nanos)
Creates a new object representing the result of adding millis and nanos
to the values from
this and normalizing the result. |
AbsoluteTime |
add(long millis,
int nanos,
AbsoluteTime dest)
Returns an object containing the value resulting from adding
millis and nanos to
the values from this and normalizing the result. |
AbsoluteTime |
add(RelativeTime time)
Creates a new instance of
AbsoluteTime representing the result of
adding time to the value of this and normalizing the result. |
AbsoluteTime |
add(RelativeTime time,
AbsoluteTime dest)
Returns an object containing the value resulting from adding
time to the value of
this and normalizing the result. |
RelativeTime |
subtract(AbsoluteTime time)
Creates a new instance of
RelativeTime representing the result of subtracting time
from the value of this and normalizing the result. |
RelativeTime |
subtract(AbsoluteTime time,
RelativeTime dest)
Returns an object containing the value resulting from subtracting
time from the value
of this and normalizing the result. |
AbsoluteTime |
subtract(RelativeTime time)
Creates a new instance of
AbsoluteTime representing the result of subtracting time
from the value of this and normalizing the result. |
AbsoluteTime |
subtract(RelativeTime time,
AbsoluteTime dest)
Returns an object containing the value resulting from subtracting
time from the value of this
and normalizing the result. |
compareTo, equals, getClock, getMilliseconds, getNanoseconds, hashCode, set, set, set, toStringpublic AbsoluteTime()
new AbsoluteTime(0,0). public AbsoluteTime(long millis,
int nanos)
AbsoluteTime object with millisecond and
nanosecond components past the real-time clock's Epoch. millis - is the desired value for the millisecond component.
The actual value is the result of parameter normalization.nanos - is the desired value for the nanosecond component.
The actual value is the result of parameter normalization.public AbsoluteTime(AbsoluteTime time)
AbsoluteTime object from the given AbsoluteTime object. time.getClock() argument
resides in a scope that encloses the current scope.
time - the object copiedjava.lang.IllegalArgumentException - if the time parameter is null.public AbsoluteTime(long millis,
int nanos,
Clock clock)
AbsoluteTime object with time millisecond
and nanosecond components past the clock's Epoch. >clock object resides
in a scope that encloses the current scope. millis - is the desired value for the millisecond component.nanos - is the desired value for the nanosecond component.clock - is the desired value for the clock.public AbsoluteTime(Clock clock)
AbsoluteTime(0,0,clock).clock - is the desired value for the clock.public AbsoluteTime add(long millis, int nanos)
this and normalizing the result.
The result will have the same clock association as this.millis - is the number of milliseconds to be added to this.nanos - is the number of nanoseconds to be added to this.AbsoluteTime object whose time is the
normalization of this plus millis and nanos.public AbsoluteTime add(long millis, int nanos, AbsoluteTime dest)
millis and nanos to
the values from this and normalizing the result. If dest is not null, the result is
placed there and returned. Otherwise, a new object is allocated for the result. this,
and the clock association with dest is ignored.millis - is the number of milliseconds to be added to this.nanos - is the number of nanoseconds to be added to this.dest - if not null, the result is placed there and returned.
Otherwise, a new object is allocated for the result.this plus millis and nanos
in dest if it is not null, otherwise the result is returned in a newly allocated object.public AbsoluteTime add(RelativeTime time)
AbsoluteTime representing the result of
adding time to the value of this and normalizing the result.time - the time to add to this.this plus the parameter time.java.lang.IllegalArgumentException - if the clock associated with this and the clock associated with the
time parameter are different, or when the time parameter is null.public AbsoluteTime add(RelativeTime time, AbsoluteTime dest)
time to the value of
this and normalizing the result. If dest is not null, the result
is placed there and returned. Otherwise, a new object is allocated for the result.
The clock associated with this and the clock associated with the time parameter
must be the same, and it is used for the result. A clock associated with the dest parameter
is ignored.time - is the time to add to this.dest - is not null, the result is placed there and returned.
Otherwise, a new object is allocated for the result.dest if it is not null,
otherwise the result is returned in a newly allocated object.java.lang.IllegalArgumentException - if the clock associated with this and the clock
associated with the time parameter are different, or when the time parameter is null.public RelativeTime subtract(AbsoluteTime time)
RelativeTime representing the result of subtracting time
from the value of this and normalizing the result.
The clock associated with this and the clock associated with the time parameter
must be the same, and it is used for the result.time - is the time to subtract from this.this minus time.java.lang.IllegalArgumentException - if the clock associated with this and the clock associated
with the time parameter are different, or when the time parameter is null.public RelativeTime subtract(AbsoluteTime time, RelativeTime dest)
time from the value
of this and normalizing the result. If dest is not null, the result is placed
there and returned. Otherwise, a new object is allocated for the result. this and the clock associated with the time parameter
must be the same, and it is used for the result. The clock associated with the dest parameter is ignored.time - is the time to subtract from this.dest - if not null, the result is placed there and returned.this minus time in dest
if it is not null, otherwise the result is returned in a newly allocated object.java.lang.IllegalArgumentException - if the clock associated with this and the clock associated
with the time parameter are different, or when the time parameter is null.public AbsoluteTime subtract(RelativeTime time)
AbsoluteTime representing the result of subtracting time
from the value of this and normalizing the result. this and the clock associated with the time parameter
must be the same, and it is used for the result.time - is the time to subtract from this.AbsoluteTime object whose time is the normalization of this minus
time.java.lang.IllegalArgumentException - if the clock associated with this and
the clock associated with the time parameter are different or when
the time parameter is null.public AbsoluteTime subtract(RelativeTime time, AbsoluteTime dest)
time from the value of this
and normalizing the result. If dest is not null, the result is placed
there and returned. Otherwise, a new object is allocated for the result.
The clock associated with this and the clock associated with the time parameter
must be the same, and it is used for the result. The clock associated with the dest parameter is ignored.time - is the time to subtract from this.dest - if not null, the result is placed there and returned.this minus time in dest
if it is not null, otherwise the result is returned in a newly allocated object.java.lang.IllegalArgumentException - if the clock associated with this and the clock associated
with the time parameter are different, or when the time parameter is null.