Class EveryMonthTimeSeries
java.lang.Object
com.amalgamasimulation.utils.time.TimeSeries
com.amalgamasimulation.utils.time.RepeatingTimeSeries
com.amalgamasimulation.utils.time.EveryMonthTimeSeries
Time series containing instants formed according to the rule: "At the
specified time of the specified day of month every month, if the month has a
day with this index."
- Author:
- Alexey Kirillov
-
Field Summary
Fields inherited from class com.amalgamasimulation.utils.time.RepeatingTimeSeries
instantTimeFields inherited from class com.amalgamasimulation.utils.time.TimeSeries
timeable -
Constructor Summary
ConstructorsConstructorDescriptionEveryMonthTimeSeries(LocalTime instantTime, int dayOfMonth, Timeable timeable) Creates a new instance ofTimeSeriescontaining instants formed according to the rule: "At the specified time of the specified day of month every month". -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetInstantsTimes(double beginTime, double endTime, boolean beginTimeInclusive, boolean endTimeInclusive) Returns an unmodifiable list containing all times of instants of this time series between the specified times.doublegetNextInstantTime(double time, boolean timeInclusive) Returns the time of the smallest instant of this time series after the specified time, orDouble.POSITIVE_INFINITYif there are no such instants in this time series.doublegetPreviousInstantTime(double time) Returns the time of the biggest instant of this time series that is strictly less than the the specified time, orDouble.NEGATIVE_INFINITYif there is no such instant.inthashCode()Methods inherited from class com.amalgamasimulation.utils.time.RepeatingTimeSeries
instantTimeMethods inherited from class com.amalgamasimulation.utils.time.TimeSeries
everyMonth, everyMonthLastDay, everyNDaysTimeSeries, everyWeekTimeSeries, getInstantsTimes, getNextInstantTime, of, of, of, relativeTimeSeries, singleTimeSeries
-
Constructor Details
-
EveryMonthTimeSeries
Creates a new instance ofTimeSeriescontaining instants formed according to the rule: "At the specified time of the specified day of month every month". For day indexes greater than 28, some months will be skipped and will not produce instants of this time series.- Parameters:
instantTime- specified time of daydayOfMonth- specified day of month, must be between 1 and 31, inclusivelytimeable-Timeableinstance that provides translation from calendar dates to number based values of instants
-
-
Method Details
-
dayOfMonthIndex
public int dayOfMonthIndex() -
getNextInstantTime
public double getNextInstantTime(double time, boolean timeInclusive) Description copied from class:TimeSeriesReturns the time of the smallest instant of this time series after the specified time, orDouble.POSITIVE_INFINITYif there are no such instants in this time series. Allows to include or exclude the specified time itself.- Specified by:
getNextInstantTimein classTimeSeries- Parameters:
time- specified timetimeInclusive- 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
-
getPreviousInstantTime
public double getPreviousInstantTime(double time) Description copied from class:TimeSeriesReturns the time of the biggest instant of this time series that is strictly less than the the specified time, orDouble.NEGATIVE_INFINITYif there is no such instant.- Specified by:
getPreviousInstantTimein classTimeSeries- Parameters:
time- 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
-
getInstantsTimes
public List<Double> getInstantsTimes(double beginTime, double endTime, boolean beginTimeInclusive, boolean endTimeInclusive) Description copied from class:TimeSeriesReturns 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:
getInstantsTimesin classTimeSeries- Parameters:
beginTime- smallest time of instants being returnedendTime- biggest time of instants being returnedbeginTimeInclusive- 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
-
hashCode
public int hashCode() -
equals
-