Data |
The DataSpec type exposes the following members.
Name | Description | |
---|---|---|
Average | Returns a non-null AverageDataSpec object with the specified Calculation and AverageBreakdown. | |
Dated | Returns a non-null DatedDataSpec object with the specified Calculation and DatedBreakdown. | |
Equals |
Two DataSpec objects are equal if they have the same class
and the same configuration.
(Overrides ObjectEquals(Object)) | |
GetHashCode |
Overridden to ensure consistency with Equals.
(Overrides ObjectGetHashCode) | |
TimeSeries | Returns a non-null TimeSeriesDataSpec object with the specified TimeSeriesCalculation and DatedBreakdown. |
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.