|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.realtime.HighResolutionTime
Class HighResolutiontime
is the base class for
AbsoluteTime, RelativeTime, RationalTime
.
Field Summary | |
protected static javax.realtime.Clock |
defaultClock
|
private long |
millis
|
private int |
nanos
|
Constructor Summary | |
HighResolutionTime()
|
Method Summary | |
abstract javax.realtime.AbsoluteTime |
absolute(javax.realtime.Clock clock)
Convert the time of this to an absolute time, relative to
the given instance of Clock . |
abstract javax.realtime.AbsoluteTime |
absolute(javax.realtime.Clock c,
javax.realtime.AbsoluteTime dest)
Convert the time of this to an absolute time, relative to
the given instance of Clock . |
int |
compareTo(javax.realtime.HighResolutionTime b)
Compares this HighResolutionTime with the specified
HighResolutionTime . |
int |
compareTo(java.lang.Object b)
Compares this HighResolutionTime with the specified
HighResolutionTime . |
boolean |
equals(javax.realtime.HighResolutionTime b)
Returns true if the argument object has the same values as this. |
boolean |
equals(java.lang.Object b)
Returns true if the argument object has the same values as this |
long |
getMilliseconds()
Returns the milliseconds component of this . |
int |
getNanoseconds()
Returns the nanoseconds component of this . |
int |
hashCode()
|
abstract javax.realtime.RelativeTime |
relative(javax.realtime.Clock clock)
Convert the time of this to a relative time, with
respect to the given instance of Clock . |
abstract javax.realtime.RelativeTime |
relative(javax.realtime.Clock clock,
javax.realtime.HighResolutionTime time)
Convert the time of this to a relative time, with
respect to the given instance of Clock . |
void |
set(javax.realtime.HighResolutionTime t)
Change the value represented by this to that of the given
time. |
void |
set(long millisecs)
Sets the millisecond component of this to the given argument. |
void |
set(long millisecs,
int nanosecs)
Sets the millisecond and nanosecond compenonets of this . |
long |
time()
Returns millis * 1000000 + nanos . |
static void |
waitForObject(java.lang.Object target,
javax.realtime.HighResolutionTime time)
Behaves exactly like target.wait() but with the enhacement
that it waits with a precision of HighResolutionTime . |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private long millis
private int nanos
protected static javax.realtime.Clock defaultClock
Constructor Detail |
public HighResolutionTime()
Method Detail |
public abstract javax.realtime.AbsoluteTime absolute(javax.realtime.Clock clock)
this
to an absolute time, relative to
the given instance of Clock
. Convenient for situations
where you really need an absolute time. Aloocates a destination object
if necessary.
clock
- An instance of Clock
is used to convert the
time of this
into absolute time.public abstract javax.realtime.AbsoluteTime absolute(javax.realtime.Clock c, javax.realtime.AbsoluteTime dest)
this
to an absolute time, relative to
the given instance of Clock
. Convenient for situations
where you really need an absolute time. Aloocates a destination object
if necessary.
dest
- If null, a new object is created and returned as result,
else dest
is returned.public int compareTo(javax.realtime.HighResolutionTime b)
HighResolutionTime
with the specified
HighResolutionTime
.
public int compareTo(java.lang.Object b)
HighResolutionTime
with the specified
HighResolutionTime
.
compareTo
in interface java.lang.Comparable
public boolean equals(javax.realtime.HighResolutionTime b)
public boolean equals(java.lang.Object b)
this.
- Overrides:
equals
in class java.lang.Object
- Parameters:
b
- Value compared to this
.
public final long getMilliseconds()
this
.
this
.public final int getNanoseconds()
this
.
public int hashCode()
hashCode
in class java.lang.Object
public abstract javax.realtime.RelativeTime relative(javax.realtime.Clock clock)
this
to a relative time, with
respect to the given instance of Clock
. Convenient
for situations where you really need a relative time. Allocates
a destination object if necessary.
clock
- An instance of Clock
is used to convert
the time of this
into realtive time.public abstract javax.realtime.RelativeTime relative(javax.realtime.Clock clock, javax.realtime.HighResolutionTime time)
this
to a relative time, with
respect to the given instance of Clock
. Convenient
for situations where you really need a relative time. Allocates
a destination object if necessary.
clock
- An instance of Clock
is used to convert
the time of this
into realtive time.time
- If null, a new object is created and returned as result,
else time
is returned.public void set(javax.realtime.HighResolutionTime t)
this
to that of the given
time. If the type of this
and the type of the given time
are not the same this method will throw IllegalArgumentException.
t
- The new value for this
.public void set(long millisecs)
this
to the given argument.
public void set(long millisecs, int nanosecs)
this
.
public static void waitForObject(java.lang.Object target, javax.realtime.HighResolutionTime time) throws java.lang.InterruptedException
target.wait()
but with the enhacement
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 indefinetly.
java.lang.InterruptedException
- If another thread interrupts this
thread while it is waiting.public long time()
millis * 1000000 + nanos
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |