|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.data.DataSpec
public abstract class DataSpec
Defines a specification of a single set of degree-day data in all aspects other than the location that the data should be generated for.
A DataSpec
defines a single set of data only (e.g. 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)));
This abstract class is not designed to be extended by third-party code, which is why it does not have an accessible constructor.
All concrete subclasses of this abstract class are immutable. You can safely reuse them and call them from multiple threads at once.
Method Summary | |
---|---|
static AverageDataSpec |
average(Calculation calculation,
AverageBreakdown averageBreakdown)
Returns an non-null AverageDataSpec object with the
specified Calculation and AverageBreakdown . |
static DatedDataSpec |
dated(Calculation calculation,
DatedBreakdown datedBreakdown)
Returns a non-null DatedDataSpec object with the specified
Calculation and DatedBreakdown . |
boolean |
equals(java.lang.Object o)
Two DataSpec objects are equal if they have the same class
and the same configuration. |
int |
hashCode()
Overridden to ensure consistency with equals . |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DatedDataSpec dated(Calculation calculation, DatedBreakdown datedBreakdown)
DatedDataSpec
object with the specified
Calculation
and DatedBreakdown
.
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.datedBreakdown
- defines the way in which the data should be broken
down and the period that it should cover. Cannot be null.
java.lang.NullPointerException
- if calculation
or
datedBreakdown
is null.average(Calculation, AverageBreakdown)
public static AverageDataSpec average(Calculation calculation, AverageBreakdown averageBreakdown)
AverageDataSpec
object with the
specified Calculation
and AverageBreakdown
.
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.
java.lang.NullPointerException
- if calculation
or
averageBreakdown
is null.dated(Calculation, DatedBreakdown)
public final boolean equals(java.lang.Object o)
DataSpec
objects are equal if they have the same class
and the same configuration.
equals
in class java.lang.Object
public final int hashCode()
equals
.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |