Click or drag to resize

DataSpec Class

Defines a specification of a single set of degree-day data (or temperature data) in all aspects other than the location that the data should be generated for.
Inheritance Hierarchy

Namespace: DegreeDays.Api.Data
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public abstract class DataSpec

The DataSpec type exposes the following members.

Methods
 NameDescription
Public methodStatic memberAverage Returns a non-null AverageDataSpec object with the specified Calculation and AverageBreakdown.
Public methodStatic memberDated Returns a non-null DatedDataSpec object with the specified Calculation and DatedBreakdown.
Public methodEquals Two DataSpec objects are equal if they have the same class and the same configuration.
(Overrides ObjectEquals(Object))
Public methodGetHashCode Overridden to ensure consistency with Equals.
(Overrides ObjectGetHashCode)
Public methodStatic memberTimeSeries Returns a non-null TimeSeriesDataSpec object with the specified TimeSeriesCalculation and DatedBreakdown.
Top
Remarks

A DataSpec defines a single set of data only (e.g. degree days in just one base temperature), but the DataSpecs class will enable you to include multiple DataSpec objects in a single LocationDataRequest.

To create a DataSpec object you can use the static factory methods of this class. For example:

DatedDataSpec thirtyMostRecentHddValues = DataSpec.Dated(
    Calculation.HeatingDegreeDays(Temperature.Fahrenheit(55)),
    DatedBreakdown.Daily(Period.LatestValues(30)));

AverageDataSpec fiveYearAverageCdd = DataSpec.Average(
    Calculation.CoolingDegreeDays(Temperature.Fahrenheit(65)),
    AverageBreakdown.FullYears(Period.LatestValues(5)));

TimeSeriesDataSpec hourlyTempsForLastCalendarYear = DataSpec.TimeSeries(
    TimeSeriesCalculation.HourlyTemperature(TemperatureUnit.Celsius),
    DatedBreakdown.Yearly(Period.LatestValues(1)));

See DatedDataSpec, AverageDataSpec, and TimeSeriesDataSpec for example code showing how to use each one individually to fetch data from the API. Though do remember that, as mentioned above, you can also fetch multiple sets of data in a single request.

This abstract class is not designed to be extended by third-party code, which is why it does not have an accessible constructor.

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