|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.realtime.HighResolutionTime
lejos.realtime.RelativeTime
public class RelativeTime
Constructor Summary | |
---|---|
RelativeTime()
Equivalent to new RelativeTime(0,0). |
|
RelativeTime(Clock clock)
Equivalent to new RelativeTime(0,0,clock). |
|
RelativeTime(long millis,
int nanos)
Construct a RelativeTime object representing an interval based on the parameter millis plus the parameter nanos. |
|
RelativeTime(long millis,
int nanos,
Clock clock)
Construct a RelativeTime object representing an interval based on the parameter millis plus the parameter nanos. |
|
RelativeTime(RelativeTime time)
|
|
RelativeTime(RelativeTime time,
Clock clock)
Make a new RelativeTime object from the given RelativeTime object. |
Method Summary | |
---|---|
AbsoluteTime |
absolute(Clock clock)
Convert the time of this to an absolute time, using the given instance of Clock to determine the current time when necessary. |
AbsoluteTime |
absolute(Clock clock,
AbsoluteTime dest)
Convert the time of this to an absolute time, using the given instance of Clock to determine the current time when necessary. |
RelativeTime |
add(long millis,
int nanos)
|
RelativeTime |
add(long millis,
int nanos,
RelativeTime dest)
|
RelativeTime |
add(RelativeTime time)
|
RelativeTime |
add(RelativeTime time,
RelativeTime dest)
|
void |
addInterarrivalTo(AbsoluteTime timeAndDestination)
|
int |
compareTo(RelativeTime o)
Compares this with another Object. |
RelativeTime |
getInterarrivalTime()
|
RelativeTime |
getInterarrivalTime(RelativeTime destination)
|
RelativeTime |
relative(Clock clock)
Convert the time of this to a relative time, using the given instance of Clock to determine the current time when necessary. |
RelativeTime |
relative(Clock clock,
RelativeTime dest)
Convert the time of this to a relative time, using the given instance of Clock to determine the current time when necessary. |
RelativeTime |
subtract(RelativeTime time)
|
RelativeTime |
subtract(RelativeTime time,
RelativeTime dest)
|
String |
toString()
|
Methods inherited from class lejos.realtime.HighResolutionTime |
---|
clone, compareTo, compareTo, equals, equals, getClock, getMilliseconds, getNanoseconds, hashCode, set, set, set, waitForObject |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RelativeTime()
public RelativeTime(Clock clock)
clock
- The clock providing the association for the newly constructed
object.public RelativeTime(long millis, int nanos)
millis
- The desired value for the millisecond component of this.
The actual value is the result of parameter normalization.nanos
- The desired value for the nanosecond component of this. The
actual value is the result of parameter normalization.
IllegalArgumentException
- Thrown if there is an overflow in the millisecond component
when normalizing.public RelativeTime(long millis, int nanos, Clock clock)
millis
- The desired value for the millisecond component of this.
The actual value is the result of parameter normalization.nanos
- The desired value for the nanosecond component of this. The
actual value is the result of parameter normalization.clock
- The clock providing the association for the newly constructed
object.
IllegalArgumentException
- Thrown if there is an overflow in the millisecond component
when normalizing.
Since:
1.0.1public RelativeTime(RelativeTime time)
public RelativeTime(RelativeTime time, Clock clock)
time
- The RelativeTime object which is the source for the copy.clock
- The clock providing the association for the newly constructed
object.
IllegalArgumentException
- Thrown if the time parameter is null.
Since:
1.0.1Method Detail |
---|
public int compareTo(RelativeTime o)
Comparable
compareTo
in interface Comparable<RelativeTime>
o
- the object to compare with
public AbsoluteTime absolute(Clock clock)
HighResolutionTime
absolute
in class HighResolutionTime
clock
- The instance of Clock used to convert the time of this into
absolute time, and the new clock association for the result.
public AbsoluteTime absolute(Clock clock, AbsoluteTime dest)
HighResolutionTime
absolute
in class HighResolutionTime
clock
- The instance of Clock used to convert the time of this into
absolute time, and the new clock association for the result.dest
- If dest is not null, the result is placed there and returned.
Otherwise, a new object is allocated for the result.
public RelativeTime add(long millis, int nanos)
public RelativeTime add(long millis, int nanos, RelativeTime dest)
public RelativeTime add(RelativeTime time)
public RelativeTime add(RelativeTime time, RelativeTime dest)
public void addInterarrivalTo(AbsoluteTime timeAndDestination)
public RelativeTime getInterarrivalTime()
public RelativeTime getInterarrivalTime(RelativeTime destination)
public RelativeTime relative(Clock clock)
HighResolutionTime
relative
in class HighResolutionTime
clock
- The instance of Clock used to convert the time of this
into relative time, and the new clock association for the result.
public RelativeTime relative(Clock clock, RelativeTime dest)
HighResolutionTime
relative
in class HighResolutionTime
clock
- The instance of Clock used to convert the time of this into
relative time, and the new clock association for the result.dest
- If dest is not null, the result is placed there and returned.
Otherwise, a new object is allocated for the result.
public RelativeTime subtract(RelativeTime time)
public RelativeTime subtract(RelativeTime time, RelativeTime dest)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |