public abstract class HighResolutionTime
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>, java.lang.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.
|
java.lang.Object |
clone()
produces a clone of this object.
|
int |
compareTo(HighResolutionTime time)
compareTo compares this to another HighResolutionTime object.
|
int |
compareTo(java.lang.Object object)
compareTo compares this to another object.
|
boolean |
equals(HighResolutionTime time)
equals checks if this and time are equal.
|
boolean |
equals(java.lang.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(java.lang.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(java.lang.Object object)
compareTo
in interface java.lang.Comparable<java.lang.Object>
object
- the object this should be compared to.public boolean equals(HighResolutionTime time)
time
- another HighResulutionTime object.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- another object.public Clock getClock()
ensure
(Result != null);
public final long getMilliseconds()
public final int getNanoseconds()
public int hashCode()
hashCode
in class java.lang.Object
public void set(HighResolutionTime time)
time
- another time object.java.lang.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(java.lang.Object target, HighResolutionTime time) throws java.lang.InterruptedException
target
- the target object to wait for.time
- The timeout given as AbsoluteTime or RelativeTime.java.lang.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 java.lang.Object clone()
clone
in class java.lang.Object
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2016 aicas GmbH. All Rights Reserved.