@SCJAllowed public class RelativeTime extends HighResolutionTime
Clock is meaningless and ignored (RTSJ thinks otherwise).| Constructor and Description |
|---|
RelativeTime()
Equivalent to
RelativeTime(0,0). |
RelativeTime(Clock clock)
Equivalent to
new RelativeTime(0, 0, clock). |
RelativeTime(long millis,
int nanos)
Constructs a
RelativeTime object representing a duration based on the parameters. |
RelativeTime(long millis,
int nanos,
Clock clock)
Constructs a
RelativeTime object representing a duration based on the parameters. |
RelativeTime(RelativeTime time)
Makes a new
RelativeTime object from the given RelativeTime object. |
| Modifier and Type | Method and Description |
|---|---|
RelativeTime |
add(long millis,
int nanos)
Creates a new object representing the result of adding millis and nanos to the values
from this
|
RelativeTime |
add(long millis,
int nanos,
RelativeTime dest)
Returns an object containing the value resulting from adding millis and nanos to this.
|
RelativeTime |
add(RelativeTime time)
Creates a new object representing the result of adding
time to the value of this |
RelativeTime |
add(RelativeTime time,
RelativeTime dest)
Returns an object containing the value resulting from adding
time to this. |
RelativeTime |
subtract(RelativeTime time)
Creates a new
RelativeTime object representing the result
of subtracting time from the value of this. |
RelativeTime |
subtract(RelativeTime time,
RelativeTime dest)
Creates a new
RelativeTime object representing the result
of subtracting time from the value of this
The result is stored in dest. |
compareTo, compareTo, equals, getClock, getMilliseconds, getNanoseconds, set, set, set, toString, waitForObjectpublic RelativeTime()
RelativeTime(0,0).public RelativeTime(long millis,
int nanos)
RelativeTime object representing a duration based on the parameters.millis - is the milliseconds.nanos - is the nanoseconds.public RelativeTime(Clock clock)
new RelativeTime(0, 0, clock).clock - is the clock argument.public RelativeTime(long millis,
int nanos,
Clock clock)
RelativeTime object representing a duration based on the parameters.millis - is the millisecondsnanos - is the nanosecondsclock - is the clockpublic RelativeTime(RelativeTime time)
RelativeTime object from the given RelativeTime object.time - is the copied object.public RelativeTime add(long millis, int nanos)
millis - is the milliseconds to be added.nanos - is the nanoseconds to be added.public RelativeTime add(RelativeTime time)
time to the value of thistime - is the duration to be added.public RelativeTime add(long millis, int nanos, RelativeTime dest)
dest.millis - millis is the milliseconds to be added.nanos - is the nanoseconds to be added.dest - is the destination, if initially null a new RelativeTime() object is created.dest object with the resulting value.public RelativeTime add(RelativeTime time, RelativeTime dest)
time to this.
The result is stored in dest.time - is the time to be addeddest - is the destination, if null a new RelativeTime() object is createddest object with the resulting value.public RelativeTime subtract(RelativeTime time)
RelativeTime object representing the result
of subtracting time from the value of this.time - the value to be subtracted.public RelativeTime subtract(RelativeTime time, RelativeTime dest)
RelativeTime object representing the result
of subtracting time from the value of this
The result is stored in dest.time - is the duration to be subtracteddest - is the destination, if null a new RelativeTime() object is createddest object with the resulting value.