Package com.reduxrobotics.frames
Class FrameData<T>
java.lang.Object
com.reduxrobotics.frames.FrameData<T>
Immutable container class for timestamped values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the timestamp in seconds of when this value was updated.getValue()
Returns the value of the data frame.static double
maxTimestamp
(FrameData<?>[] dataArray) Fetches the maximum CAN timestamp out of an array of FrameData objects
-
Constructor Details
-
FrameData
Constructs a new FrameData object.- Parameters:
value
- The value to hold.timestamp
- The timestamp at which the value was received in seconds.
-
-
Method Details
-
getValue
Returns the value of the data frame.- Returns:
- the value the data frame holds.
-
getTimestamp
public double getTimestamp()Gets the timestamp in seconds of when this value was updated.- Returns:
- the timestamp in seconds.
-
maxTimestamp
Fetches the maximum CAN timestamp out of an array of FrameData objects- Parameters:
dataArray
- array value likely begotten fromFrame.waitForFrames(double, com.reduxrobotics.frames.Frame<?>...)
- Returns:
- the max timestamp value
-