@SCJAllowed public class AbsoluteTime extends HighResolutionTime
RelativeTime in add and subtract is ignored (RTSJ throws an exception) RelativeTime time in add is null, an IllegalArgumentException is thrown AbsoluteTime time in subtract is null, an IllegalArgumentException is thrown AbsoluteTime subtract, an IllegalArgumentException is thrown.| Constructor and Description |
|---|
AbsoluteTime(AbsoluteTime time)
Makes a new object that is a copy from the parameter
time. |
AbsoluteTime(Clock clock)
Equivalent to
AbsoluteTime(0,0,clock). |
AbsoluteTime(long millis,
int nanos)
Constructs an
AbsoluteTime object with time 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, compareTo, equals, getClock, getMilliseconds, getNanoseconds, set, set, set, toString, waitForObjectpublic AbsoluteTime(long millis,
int nanos)
AbsoluteTime object with time millisecond and nanosecond components
past the real-time clock's Epoch. millis - is the desired value for the millisecond componentnanos - is the desired value for the nanosecond component.public AbsoluteTime(AbsoluteTime time)
time.time - the object copiedpublic AbsoluteTime(long millis,
int nanos,
Clock clock)
AbsoluteTime object with time millisecond and nanosecond components
past the clock's Epoch.millis - is the desired value for the millisecond componentnanos - is the desired value for the nanosecond component.clock - is the desired value for the clockpublic AbsoluteTime(Clock clock)
AbsoluteTime(0,0,clock).clock - is the desired value for the clockpublic AbsoluteTime add(long millis, int nanos)
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)
dest.millis - is he number of milliseconds to be added to this.nanos - is the number of nanoseconds to be added to this.dest - if null a new dest object is created, the result is placed there and returned.dest objectpublic 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.time.public AbsoluteTime add(RelativeTime time, AbsoluteTime dest)
time to the value of this
and normalizing the result. The result is placed in dest.time - is the time to add to thisdest - if null a new dest object is created, the result is placed there and returned.dest objectpublic RelativeTime subtract(AbsoluteTime time)
RelativeTime representing the result of subtracting time
from the value of this and normalizing the result.time - is the time to subtract from this.time.public RelativeTime subtract(AbsoluteTime time, RelativeTime dest)
time from the value
of this and normalizing the result. The result is placed in dest.time - is the time to subtract from this.dest - if null a new dest object is created, the result is placed there and returned.dest objectpublic AbsoluteTime subtract(RelativeTime time)
AbsoluteTime representing the result of subtracting time
from the value of this and normalizing the result.time - is the time to subtract from this.AbsoluteTime object whose time is the normalization of this minus time.public AbsoluteTime subtract(RelativeTime time, AbsoluteTime dest)
time from the value of this
and normalizing the result. The result is placed in dest.time - is the time to subtract from to thisdest - if null a new dest object is created, the result is placed there and returned.dest object