public abstract class HighResolutionTime extends Object implements Comparable<Object>, Cloneable
Modifier and Type | Method and Description |
---|---|
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.
|
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.Object.hashCode()
,
HashMap
public Clock getClock()
ensure
(Result != null);
public final long getMilliseconds()
public final int getNanoseconds()
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public void set(HighResolutionTime time)
IllegalArgumentException
- iff time is an instance of a different
class than this
.time
- another time object.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
InterruptedException
- if another thread caused this
thread to be interrupted during the wait.target
- the target object to wait for.time
- The timeout given as AbsoluteTime or RelativeTime.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.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2016 aicas GmbH. All Rights Reserved.