Class ValueWithTime<T>

java.lang.Object
net.maswag.falcaun.ValueWithTime<T>
Type Parameters:
T - The type of the values

public class ValueWithTime<T> extends Object
A pair of time and values.
  • Field Details

    • timestamps

      protected final List<Double> timestamps
    • values

      protected final List<T> values
  • Constructor Details

    • ValueWithTime

      ValueWithTime()
    • ValueWithTime

      ValueWithTime(List<Double> timestamps, List<T> values)
  • Method Details

    • size

      public int size()
      Get the number of contained values.
    • at

      @Nullable public T at(double time)
      Get the value at the given time.
    • range

      public ValueWithTime<T> range(double from, double to)
      Get the values in the given time range.
      Parameters:
      from - The start time (non-inclusive)
      to - The end time (inclusive)
    • stream

      public Stream<List<T>> stream(double signalStep)
      Stream the List of values between each signal step.

      The i-th element is the list of values between (i-1) * signalStep and i * signalStep

      Parameters:
      signalStep - The time step between each signal