net.degreedays.api.data
Class AverageDataSpec

java.lang.Object
  extended by net.degreedays.api.data.DataSpec
      extended by net.degreedays.api.data.AverageDataSpec
All Implemented Interfaces:
java.io.Serializable

public final class AverageDataSpec
extends DataSpec
implements java.io.Serializable

Defines a specification for a set of average data such as 5-year-average degree days.

An AverageDataSpec specifies a set of average degree days in terms of:

To request multiple sets of average data with different calculation processes (e.g. multiple different base temperatures) and/or different breakdowns, simply put multiple AverageDataSpec objects into the DataSpecs object that you pass into your LocationDataRequest.

See Also:
DatedDataSpec

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


Constructor Summary
AverageDataSpec(Calculation calculation, AverageBreakdown averageBreakdown)
          Constructs an AverageDataSpec object with the specified Calculation and AverageBreakdown.
 
Method Summary
 AverageBreakdown breakdown()
          Returns the non-null AverageBreakdown that defines the way in which the degree days should be broken down and the period in time that they should cover.
 Calculation calculation()
          Returns the non-null Calculation object that defines the way in which the degree days should be calculated in terms of their base temperature and whether they should be heating degree days or cooling degree days.
 java.lang.String toString()
          Returns a non-null, non-empty string representation of this object for logging and debugging purposes.
 
Methods inherited from class net.degreedays.api.data.DataSpec
average, dated, equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AverageDataSpec

public AverageDataSpec(Calculation calculation,
                       AverageBreakdown averageBreakdown)
Constructs an AverageDataSpec object with the specified Calculation and AverageBreakdown.

Parameters:
calculation - defines the way in which the degree days should be calculated in terms of their base temperature and whether they should be heating degree days or cooling degree days. Cannot be null.
averageBreakdown - defines the way in which the data should be broken down and the period that it should cover. Cannot be null.
Throws:
java.lang.NullPointerException - if calculation or averageBreakdown is null.
Method Detail

calculation

public Calculation calculation()
Returns the non-null Calculation object that defines the way in which the degree days should be calculated in terms of their base temperature and whether they should be heating degree days or cooling degree days.


breakdown

public AverageBreakdown breakdown()
Returns the non-null AverageBreakdown that defines the way in which the degree days should be broken down and the period in time that they should cover.


toString

public java.lang.String toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.

The exact details of the representation are unspecified and subject to change.

Overrides:
toString in class java.lang.Object


www.degreedays.net/api/