Class BoundedTimeSeries

java.lang.Object
com.amalgamasimulation.utils.time.TimeSeries
com.amalgamasimulation.utils.time.BoundedTimeSeries

public class BoundedTimeSeries extends TimeSeries
Time series that bounds an instance of other time series on the left and right along the time axis.
Author:
Andrey Korotin
  • Constructor Details

    • BoundedTimeSeries

      public BoundedTimeSeries(TimeSeries baseTimeSeries, double beginTime, double endTime)
      Creates a new instance of TimeSeries that bounds an instance of the specified time series on the left and right along the time axis.
      Parameters:
      baseTimeSeries - specified time series instances
      beginTime - left time boundary
      endTime - right time boundary
    • BoundedTimeSeries

      public BoundedTimeSeries(TimeSeries baseTimeSeries, LocalDateTime beginDate, LocalDateTime endDate)
      Creates a new instance of TimeSeries that bounds an instance of the specified time series on the left and right along the time axis.
      Parameters:
      baseTimeSeries - specified time series instances
      beginDate - left date time boundary
      endDate - right date time boundary
  • Method Details

    • getPreviousInstantTime

      public double getPreviousInstantTime(double beforeTime)
      Description copied from class: TimeSeries
      Returns the time of the biggest instant of this time series that is strictly less than the the specified time, or Double.NEGATIVE_INFINITY if there is no such instant.
      Specified by:
      getPreviousInstantTime in class TimeSeries
      Parameters:
      beforeTime - specified time
      Returns:
      time of the biggest instant of this time series that is strictly less than the the specified time, or Double.NEGATIVE_INFINITY
    • getNextInstantTime

      public double getNextInstantTime(double time, boolean timeInclusive)
      Description copied from class: TimeSeries
      Returns the time of the smallest instant of this time series after the specified time, or Double.POSITIVE_INFINITY if there are no such instants in this time series. Allows to include or exclude the specified time itself.
      Specified by:
      getNextInstantTime in class TimeSeries
      Parameters:
      time - specified time
      timeInclusive - whether to include or exclude the specified time
      Returns:
      time of the smallest instant of this time series after the specified time, or Double.POSITIVE_INFINITY
    • getInstantsTimes

      public List<Double> getInstantsTimes(double beginTime, double endTime, boolean beginTimeInclusive, boolean endTimeInclusive)
      Description copied from class: TimeSeries
      Returns an unmodifiable list containing all times of instants of this time series between the specified times. If there are no such instants, an empty list is returned. Allows to include or exclude the boundaries of the specified time interval.
      Specified by:
      getInstantsTimes in class TimeSeries
      Parameters:
      beginTime - smallest time of instants being returned
      endTime - biggest time of instants being returned
      beginTimeInclusive - whether to include or exclude the right boundary (beginTime)
      endTimeInclusive - whether to include or exclude the left boundary (endTime)
      Returns:
      unmodifiable list containing all times of instants of this time series between the specified times