Package tech.units.indriya.quantity.time
Class TimedData<T>
- java.lang.Object
-
- tech.units.indriya.quantity.time.TimedData<T>
-
- Type Parameters:
T- The data value.
- All Implemented Interfaces:
Supplier<T>,tech.uom.lib.common.function.Nameable
- Direct Known Subclasses:
TimedQuantityData
public class TimedData<T> extends Object implements tech.uom.lib.common.function.Nameable, Supplier<T>
TimedData is a container for a data value that keeps track of its age. This class keeps track of the birth time of a bit of data, i.e. time the object is instantiated.
The TimedData MUST be immutable.- Since:
- 1.0
- Version:
- 0.7
- Author:
- Werner Keil
- See Also:
- Wikipedia: Time Series
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Tget()InstantgetInstant()StringgetName()longgetTimestamp()Returns the time with which this TimedData was created.inthashCode()static <T> TimedData<T>of(T val, long time)Returns aTimedDatawith the specified values.static <T> TimedData<T>of(T val, long time, String name)Returns aTimedDatawith the specified values.StringtoString()
-
-
-
Method Detail
-
of
public static <T> TimedData<T> of(T val, long time)
Returns aTimedDatawith the specified values.- Type Parameters:
T- the class of the value- Parameters:
val- The value for the timed data.time- The timestamp.- Returns:
- an
TimedDatawith the given values
-
of
public static <T> TimedData<T> of(T val, long time, String name)
Returns aTimedDatawith the specified values.- Type Parameters:
T- the class of the value- Parameters:
val- The value for the timed data.time- The timestamp.name- The name.- Returns:
- an
TimedDatawith the given values
-
getTimestamp
public long getTimestamp()
Returns the time with which this TimedData was created.- Returns:
- the time of creation
-
getName
public String getName()
- Specified by:
getNamein interfacetech.uom.lib.common.function.Nameable
-
getInstant
public Instant getInstant()
-
-