|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.HighResolutionTime
Class HighResolutionTime
is the base class for AbsoluteTime, RelativeTime, RationalTime.
Method Summary | |
abstract AbsoluteTime |
absolute(Clock clock)
Convert this time to an absolute time, relative to some clock. |
abstract AbsoluteTime |
absolute(Clock clock,
AbsoluteTime dest)
Convert this time to an absolute time, relative to some clock. |
int |
compareTo(HighResolutionTime time)
Compares this HighResolutionTime with the specified HighResolutionTime. |
int |
compareTo(java.lang.Object object)
For the Comparable interface. |
boolean |
equals(HighResolutionTime time)
Returns true if the argument object has the same values as this. |
boolean |
equals(java.lang.Object object)
Returns true if the argument is a HighResolutionTime reference and has the same values as this. |
long |
getMilliseconds()
Returns the milliseconds component of this. |
int |
getNanoseconds()
Returns nanoseconds component of this. |
int |
hashCode()
|
abstract RelativeTime |
relative(Clock clock)
Change the association of this from the currently associated clock to the given clock. |
abstract RelativeTime |
relative(Clock clock,
HighResolutionTime time)
Convert the given instance of HighResolutionTime to an instance
of RelativeTime relative to the given instance of Clock . |
void |
set(HighResolutionTime time)
Changes the time represented by the argument to some time between the invocation of the method and the return of the method. |
void |
set(long millis)
Sets the millisecond component of this to the given argument. |
void |
set(long millis,
int nanos)
Sets the millisecond and nanosecond components of this. |
static void |
waitForObject(java.lang.Object target,
HighResolutionTime time)
Behaves exactly like target.wait() but with the enhancement
that it waits with a precision of HighResolutionTime |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public abstract AbsoluteTime absolute(Clock clock)
clock
- This clock is used to convert this time into absolute time.public abstract AbsoluteTime absolute(Clock clock, AbsoluteTime dest)
clock
- This clock is used to convert this time into absolute time.dest
- If null, a new object is created and returned as result, else dest is returned.public int compareTo(HighResolutionTime time)
time
- compares with this time.public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
public boolean equals(HighResolutionTime time)
time
- Values are compared to this.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Values are compared to this.public final long getMilliseconds()
public final int getNanoseconds()
public int hashCode()
hashCode
in class java.lang.Object
public void set(HighResolutionTime time)
time
- The HighResolutionTime which will be set to represent the
current time.public void set(long millis)
millis
- This value will be the value of the millisecond component
of this at the completion of the call. If millis
is negative the
millisecond value of this is set to negative value. Although logically
this may represent time before the epoch, invalid results may occur if
a HighResolutionTime
representing time before the epoch is given as a
parameter to the methods.public void set(long millis, int nanos)
millis
- Value to set millisecond part of this. If millis
is negative the
millisecond value of this is set to negative value. Although logically
this may represent time before the epoch, invalid results may occur if
a HighResolutionTime
representing time before the epoch is given as a
parameter to the methods.nanos
- Value to set nanosecond part of this. If nanos
is negative the
millisecond value of this is set to negative value. Although logically
this may represent time before the epoch, invalid results may occur if
a HighResolutionTime
representing time before the epoch is given as a
parameter to the methods.public static void waitForObject(java.lang.Object target, HighResolutionTime time) throws java.lang.InterruptedException
target.wait()
but with the enhancement
that it waits with a precision of HighResolutionTime
target
- The object on which to wait. The current thread must have a
lock on the object.time
- The time for which to wait. If this is RelativeTime(0,0)
then wait indefinitely.java.lang.InterruptedException
- If another threads interrupts this thread
while its waiting.Object.wait(long)
,
Object.wait(long)
,
Object.wait(long,int)
public abstract RelativeTime relative(Clock clock)
public abstract RelativeTime relative(Clock clock, HighResolutionTime time)
HighResolutionTime
to an instance
of RelativeTime
relative to the given instance of Clock
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |