public class TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity> extends java.lang.Object implements ITimestampedValue, ICopy<TimestampedValue<T>>, IValueInterpolator<TimestampedValue<T>>
Constructor and Description |
---|
TimestampedValue() |
TimestampedValue(T value)
Default constructor for a TimestampedValue
|
TimestampedValue(TimestampedValue<T> src)
Copy constructor; initializes all values to that of the source
TimestampedValue
|
TimestampedValue(T src,
long timestamp)
Constructor allowing a TimestampedValue
|
Modifier and Type | Method and Description |
---|---|
void |
copy(TimestampedValue<T> t)
Initalizes this TimestampedValue to be equal to the source
TimestampedValue
|
boolean |
getInterpolated()
If true, this TimestampedValue
|
IQuantity |
getQuantity() |
long |
getTimestamp()
Returns the timestamp for this TimestampedValue.
|
boolean |
getValid()
Returns whether this TimestampedValue is valid or not.
|
T |
getValue() |
TimestampedValue<T> |
instantiate_copy() |
void |
interpolate(TimestampedValue<T> to,
double time_ratio,
TimestampedValue<T> out)
Modifies this TimestampedValue (representing the "from" value) to
represent a new value and Timestamp value which is located at a ratio (in
time) between itself and a "to" TimestampedValue.
|
void |
set(TimestampedValue<T> src)
Initalizes this TimestampedValue to be equal to the source
TimestampedValue
|
void |
set(T src,
long timestamp)
Initializes this TimestampedValue to be equal to the source value object
and a timestamp.
|
void |
setInterpolated(boolean interpolated)
Modifies this TimestampedValue
|
void |
setTimestamp(long timestamp) |
void |
setValid(boolean valid)
Sets whether this TimestampedValue is valid or not.
|
public TimestampedValue()
public TimestampedValue(T value)
public TimestampedValue(T src, long timestamp)
src
- - source T objecttimestamp
- - timestamp representing the time at which the source value is
valid.public TimestampedValue(TimestampedValue<T> src)
src
- - source TimestampedValuepublic long getTimestamp()
getTimestamp
in interface ITimestampedValue
public void setTimestamp(long timestamp)
public void set(TimestampedValue<T> src)
src
- - source TimestampedValuepublic void set(T src, long timestamp)
src
- - source Quaterniontimestamp
- - timestamp representing the time at which the source value
object is valid.public T getValue()
public boolean getInterpolated()
getInterpolated
in interface IValueInterpolator<TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity>>
public void setInterpolated(boolean interpolated)
setInterpolated
in interface IValueInterpolator<TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity>>
interpolated
- - true if the object is interpolated, false if it is actual
(measured).public void interpolate(TimestampedValue<T> to, double time_ratio, TimestampedValue<T> out)
This actual method of interpolation used depends upon the value type (T).
interpolate
in interface IValueInterpolator<TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity>>
to
- - the "to" object (also of type T) representing an object
which is "later" in time than this object.time_ratio
- - the ratio (from 0 to 1) in time between this object and the
"to" object at which point the interpolated value should
occur.public void copy(TimestampedValue<T> t)
copy
in interface IValueInterpolator<TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity>>
copy
in interface ICopy<TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity>>
src
- - source TimestampedValuepublic boolean getValid()
getValid
in interface ITimestampedValue
public void setValid(boolean valid)
setValid
in interface ITimestampedValue
valid
- - true if this object is currently valid, false if not.public TimestampedValue<T> instantiate_copy()
instantiate_copy
in interface ICopy<TimestampedValue<T extends ICopy<T> & IInterpolate<T> & IQuantity>>
public IQuantity getQuantity()
getQuantity
in interface ITimestampedValue