|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.HighResolutionTime
public abstract class HighResolutionTime
Jamaica Real-Time Specification for Java abstract class HighResolutionTime.
Method Summary | |
---|---|
abstract AbsoluteTime |
absolute(Clock clock)
absolute converts this time to an absolute time relative to the given clock. |
abstract AbsoluteTime |
absolute(Clock clock,
AbsoluteTime dest)
absolute converts this time to an absolute time relative to the given clock. |
Object |
clone()
produces a clone of this object. |
int |
compareTo(HighResolutionTime time)
compareTo compares this to another HighResolutionTime object. |
int |
compareTo(Object object)
compareTo compares this to another object. |
boolean |
equals(HighResolutionTime time)
equals checks if this and time are equal. |
boolean |
equals(Object object)
equals checks if this and object are equal. |
Clock |
getClock()
getClock returns a reference to the clock associated with this. |
long |
getMilliseconds()
getMilliseconds returns the milliseconds part of this time object. |
int |
getNanoseconds()
getNanoseconds returns the nanoseconds part of this time object.The time represented by this is getMilliseconds()*1000000+ getNanosecondes() ns. |
int |
hashCode()
hashCode calculates a hashCode for this. |
abstract RelativeTime |
relative(Clock clock)
relative returns a new relative time object for this relative to the given clock. |
abstract RelativeTime |
relative(Clock clock,
RelativeTime time)
relative converts this time to a relative time using the given clock. |
void |
set(HighResolutionTime time)
set sets this time to the time specified by time. |
void |
set(long millis)
set sets the milliseconds value of this object to millis. |
void |
set(long millis,
int nanos)
set sets the milliseconds and nanoseconds value of this object to millis and nanos. |
static void |
waitForObject(Object target,
HighResolutionTime time)
waitForObject waits for the given object using a HighResolutionTime as timeout. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract AbsoluteTime absolute(Clock clock)
clock
- The clock the result should be relative to.
public abstract AbsoluteTime absolute(Clock clock, AbsoluteTime dest)
clock
- The clock the result should be relative to.dest
- The preallocated AbsoluteTime object to hold the
result. May be null to indicate that a new object should be
allocated.
public int compareTo(HighResolutionTime time)
time
- the time object this should be compared with.
public int compareTo(Object object)
compareTo
in interface Comparable<Object>
object
- the object this should be compared to.
public boolean equals(HighResolutionTime time)
time
- another HighResulutionTime object.
public boolean equals(Object object)
equals
in class Object
object
- another object.
public Clock getClock()
ensure
(Result != null);
public final long getMilliseconds()
public final int getNanoseconds()
public int hashCode()
hashCode
in class Object
public void set(HighResolutionTime time)
time
- another time object.
IllegalArgumentException
- iff time is an instance of a different
class than this
.public void set(long millis)
ensure
(getMilliseconds() == millis);
millis
- the new value for the milliseconds.public void set(long millis, int nanos)
ensure
(getMilliseconds() == millis, getNanoseconds() == nanos);
millis
- the new value for the milliseconds.nanos
- the new value for the nanoseconds.public static void waitForObject(Object target, HighResolutionTime time) throws InterruptedException
target
- the target object to wait for.time
- The timeout given as AbsoluteTime or RelativeTime.
InterruptedException
- if another thread caused this
thread to be interrupted during the wait.public abstract RelativeTime relative(Clock clock)
clock
- The clock the result should be relative to.
public abstract RelativeTime relative(Clock clock, RelativeTime time)
clock
- The clock the result should be relative to.time
- The preallocated RelativeTime object to hold the
result. May be null to indicate that a new object should be
allocated.
public Object clone()
clone
in class Object
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |