public class Time extends TimeBase<Time>
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
The primitive type.
|
FIELD_NSECS, FIELD_SECS, MILLI_TO_NSECS, MILLI_TO_SECS, nsecs, NSECS_TO_MILLI, NSECS_TO_SECS, secs, SECS_TO_MILLI, SECS_TO_NSECSEMPTY_MESSAGEEMPTY_JSON| Constructor and Description |
|---|
Time()
Create a new Time with a default of 0.
|
Time(double sec)
Create a new Time with the given time in seconds (and partial seconds).
|
Time(int secs,
int nsecs)
Create a new Time with the given seconds and nanoseconds values.
|
Time(long nano)
Create a new Time with the given time in nanoseconds.
|
| Modifier and Type | Method and Description |
|---|---|
Time |
add(Time t)
Add the given Time to this Time and return a new Time with that value.
|
Time |
clone()
Create a clone of this Time.
|
static Time |
fromDate(Date date)
Create a new Time from the given Java Data object.
|
static Time |
fromJsonObject(javax.json.JsonObject jsonObject)
Create a new Time based on the given JSON object.
|
static Time |
fromJsonString(String jsonString)
Create a new Time based on the given JSON string.
|
static Time |
fromNano(long nano)
Create a new Time message based on the given nanoseconds.
|
static Time |
fromSec(double sec)
Create a new Time message based on the given seconds.
|
boolean |
isValid()
Check if this Time is valid.
|
static Time |
now()
Create a new Time message based on the current system time.
|
static boolean |
sleepUntil(Time t)
Sleep until the given time.
|
Time |
subtract(Time t)
Subtract the given Time from this Time and return a new Time with that
value.
|
Date |
toDate()
Crate a new Java Date object based on this message.
|
compareTo, getNsecs, getSecs, isZero, toNSec, toSecfromUInt16, fromUInt16, fromUInt32, fromUInt32, fromUInt64, fromUInt64, fromUInt8, fromUInt8, getPrimitiveType, setPrimitiveType, toUInt16, toUInt16, toUInt32, toUInt32, toUInt64, toUInt64, toUInt8, toUInt8equals, hashCode, toJsonObject, toStringpublic static final String TYPE
public Time()
public Time(int secs,
int nsecs)
secs - The seconds value of this time.nsecs - The nanoseconds value of this time.public Time(double sec)
sec - The time in seconds.public Time(long nano)
sec - The time in nanoseconds.public Time subtract(Time t)
public boolean isValid()
public Date toDate()
public static boolean sleepUntil(Time t)
t - The time to sleep until.public Time clone()
public static Time now()
public static Time fromSec(double sec)
sec - The time in seconds.public static Time fromNano(long nano)
nano - The time in nanoseconds.public static Time fromDate(Date date)
date - The Date to create a Time from.public static Time fromJsonString(String jsonString)
jsonString - The JSON string to parse.public static Time fromJsonObject(javax.json.JsonObject jsonObject)
jsonObject - The JSON object to parse.Copyright © 2014. All rights reserved.