Click or drag to resize

LatestValuesPeriod Class

A type of Period that automatically resolves to a date range including the latest available data and the specified number of degree-day values.
Inheritance Hierarchy
SystemObject
  DegreeDays.Api.DataPeriod
    DegreeDays.Api.Data.ImplLatestValuesPeriod

Namespace:  DegreeDays.Api.Data.Impl
Assembly:  DegreeDays (in DegreeDays.dll) Version: 1.3
Syntax
public sealed class LatestValuesPeriod : Period

The LatestValuesPeriod type exposes the following members.

Constructors
  NameDescription
Public methodLatestValuesPeriod(Int32)
Constructs a LatestValuesPeriod object that automatically resolves to a date range including the latest available data and the specified number of degree-day values.
Top
Properties
  NameDescription
Public propertyMinimumNumberOfValues
Gets the number, greater than zero, that was specified using WithMinimumNumberOfValues(Int32), or null if no such minimum number of values was specified.
Public propertyNumberOfValues
Gets the number, greater than zero, indicating how many degree-day values this period should cover (see these remarks on how the values in question can be daily, weekly, monthly, or yearly).
Top
Methods
  NameDescription
Public methodEquals(Object)
Two Period objects are equal if it can be ascertained that they will always represent the same period in time as each other when compared at the same time and in the same context.
(Inherited from Period.)
Public methodGetHashCode
Overridden to ensure consistency with Equals.
(Inherited from Period.)
Public methodToString
Returns a non-null, non-empty string representation of this instance for logging and debugging purposes.
(Overrides ObjectToString.)
Public methodWithMinimumNumberOfValues(Int32)
Returns a new LatestValuesPeriod with the same NumberOfValues as this, but also specifying minimumNumberOfValues as the minimum number of values required.
Top
Remarks
The meaning of the specified number of values depends on the type of the Breakdown that holds this period. For example, if you create a LatestValuesPeriod specifying x values then:
  • Used as the Period in a DailyBreakdown it would specify the x most recent days of data.
  • Used as the Period in a WeeklyBreakdown it would specify the x most recent weeks of data.
  • Used as the Period in a MonthlyBreakdown it would specify the x most recent months of data.
  • Used as the Period in a YearlyBreakdown it would specify the x most recent years of data.
  • Used as the Period in a FullYearsAverageBreakdown it would specify the x most recent full calendar years of data.

If you want data covering specific dates, you may be better off using a DayRangePeriod. But this class can be a useful convenience if you want the latest available data containing a specific number of daily, weekly, monthly, or yearly values. It can save you from some date arithmetic, and you won't need to consider the time-zones or update delays of the weather stations that you're getting data from to figure out the exact dates of the latest data that is likely to be available.

Thread Safety
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
See Also