@SCJAllowed public abstract class HighResolutionTime extends java.lang.Object implements java.lang.Comparable<HighResolutionTime>
HighResolutionTime is the base class for time given with nanosecond accuracy.
A time object in normalized form represents negative time if both components are
nonzero and negative, or one is nonzero and negative and the other is zero.
For add and subtract operations, negative values behave as they do in Java arithmetic.
Methods of this class are not synchronized by the implementation.
AbsoluteTime set: if parameter null, no Exception?
- implementation issue:
public int compareTo (Object arg0) is inherited from
interface Comparable
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(HighResolutionTime time)
Compares
this with the specified HighResolutionTime time. |
boolean |
equals(HighResolutionTime time) |
Clock |
getClock() |
long |
getMilliseconds() |
int |
getNanoseconds() |
int |
hashCode() |
void |
set(HighResolutionTime time)
Change the value represented by
this to that of the given time. |
void |
set(long millis)
Sets the millisecond component of
this to the given argument,
and the nanosecond component of this to 0. |
void |
set(long millis,
int nanos)
Sets the millisecond and nanosecond components of
this to the given arguments. |
java.lang.String |
toString() |
public final Clock getClock()
this.public final long getMilliseconds()
this.public final int getNanoseconds()
this.public void set(HighResolutionTime time)
this to that of the given time.time - is the new value for this.java.lang.ClassCastException - if the time parameter is not
of the same class as this.java.lang.IllegalArgumentException - if the time parameter is
not associated with the same clock as this, or when
the time parameter is null.public void set(long millis)
this to the given argument,
and the nanosecond component of this to 0.
The clock is unchanged.millis - is the new value of the millisecond component.public void set(long millis,
int nanos)
this to the given arguments.
The clock is unchanged.millis - is the new value of the millisecond component.nanos - is the new value of the nanosecond component.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(HighResolutionTime time)
time - time is of the same
type and has the same values as this.public int compareTo(HighResolutionTime time)
this with the specified HighResolutionTime time.compareTo in interface java.lang.Comparable<HighResolutionTime>time - is the second argument to the comparison.this
object is less than, equal to, or greater than time.java.lang.ClassCastException - if the time parameter is not
of the same class as this.java.lang.IllegalArgumentException - if the time parameter is
not associated with the same clock as this, or when
the time parameter is null.public java.lang.String toString()
toString in class java.lang.Object