T - The type of TimeBase used in add and subtract.public abstract class TimeBase<T extends Primitive> extends Primitive implements Comparable<TimeBase<T>>
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_NSECS
The name of the nanoseconds field for the Primitive.
|
static String |
FIELD_SECS
The name of the seconds field for the Primitive.
|
protected static long |
MILLI_TO_NSECS
The number of milliseconds in a second.
|
protected static double |
MILLI_TO_SECS
The fraction of a second in a millisecond.
|
int |
nsecs |
protected static double |
NSECS_TO_MILLI
The number of milliseconds in a second.
|
protected static double |
NSECS_TO_SECS
The fraction of a second in a nanosecond.
|
int |
secs |
protected static long |
SECS_TO_MILLI
The number of milliseconds in a second.
|
protected static long |
SECS_TO_NSECS
The number of nanoseconds in a second.
|
EMPTY_MESSAGEEMPTY_JSON| Constructor and Description |
|---|
TimeBase(double sec,
String type)
Create a new TimeBase with the given time in seconds (and partial
seconds).
|
TimeBase(int secs,
int nsecs,
String type)
Create a new TimeBase with the given time in seconds and nanoseconds.
|
TimeBase(long nano,
String type)
Create a new TimeBase with the given time in nanoseconds.
|
TimeBase(String type)
Create an empty TimeBase with the given type field.
|
| Modifier and Type | Method and Description |
|---|---|
abstract T |
add(T t)
Add the given type to this TimeBase and return a new object with that
value.
|
abstract T |
clone()
Create a clone of this TimeBase.
|
int |
compareTo(TimeBase<T> t)
Compare the given TimeBase object to this one.
|
int |
getNsecs()
Get the nanoseconds value of this TimeBase.
|
int |
getSecs()
Get the seconds value of this TimeBase.
|
boolean |
isZero()
Check if the value of this TimeBase is zero.
|
abstract T |
subtract(T t)
Subtract the given type to this TimeBase and return a new object with
that value.
|
long |
toNSec()
Convert this TimeBase to nanoseconds.
|
double |
toSec()
Convert this TimeBase to seconds (and partial seconds).
|
fromUInt16, fromUInt16, fromUInt32, fromUInt32, fromUInt64, fromUInt64, fromUInt8, fromUInt8, getPrimitiveType, setPrimitiveType, toUInt16, toUInt16, toUInt32, toUInt32, toUInt64, toUInt64, toUInt8, toUInt8equals, hashCode, toJsonObject, toStringpublic static final String FIELD_SECS
public static final String FIELD_NSECS
protected static final long SECS_TO_MILLI
protected static final double MILLI_TO_SECS
protected static final long SECS_TO_NSECS
protected static final double NSECS_TO_SECS
protected static final long MILLI_TO_NSECS
protected static final double NSECS_TO_MILLI
public final int secs
public final int nsecs
public TimeBase(String type)
type - The type of primitive.public TimeBase(double sec,
String type)
sec - The time in seconds.type - The type of TimeBase primitive.public TimeBase(long nano,
String type)
nano - The time in nanoseconds.type - The type of TimeBase primitive.public TimeBase(int secs,
int nsecs,
String type)
secs - The amount of seconds.nsecs - The amount of additional nanoseconds.type - The type of TimeBase primitive.public int getSecs()
public int getNsecs()
public boolean isZero()
public double toSec()
public long toNSec()
public int compareTo(TimeBase<T> t)
compareTo in interface Comparable<TimeBase<T extends Primitive>>t - The TimeBase to compare to.public abstract T add(T t)
t - Add the given type to this TimeBase.public abstract T subtract(T t)
t - Subtract the given type to this TimeBase.public abstract T clone()
clone in class JsonWrapperCopyright © 2014. All rights reserved.