public abstract class Calculation
extends java.lang.Object
To create a Calculation
object you can use the static
factory methods of this class. For example:
Calculation hdd = Calculation.heatingDegreeDays(Temperature.celsius(12.5));
Calculation cdd = Calculation.coolingDegreeDays(Temperature.celsius(21));
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.
Modifier and Type | Method and Description |
---|---|
static CoolingDegreeDaysCalculation |
coolingDegreeDays(Temperature baseTemperature)
Returns a non-null
CoolingDegreeDaysCalculation object with
the specified base temperature. |
boolean |
equals(java.lang.Object o)
Two
Calculation objects are equal if they have the same
class and the same configuration. |
int |
hashCode()
Overridden to ensure consistency with
equals . |
static HeatingDegreeDaysCalculation |
heatingDegreeDays(Temperature baseTemperature)
Returns a non-null
HeatingDegreeDaysCalculation object with
the specified base temperature. |
public static HeatingDegreeDaysCalculation heatingDegreeDays(Temperature baseTemperature)
HeatingDegreeDaysCalculation
object with
the specified base temperature.baseTemperature
- the base temperature that the heating degree days
should be calculated to. Cannot be null
.java.lang.NullPointerException
- if baseTemperature
is
null
.coolingDegreeDays(Temperature)
public static CoolingDegreeDaysCalculation coolingDegreeDays(Temperature baseTemperature)
CoolingDegreeDaysCalculation
object with
the specified base temperature.baseTemperature
- the base temperature that the cooling degree days
should be calculated to. Cannot be null
.java.lang.NullPointerException
- if baseTemperature
is
null
.heatingDegreeDays(Temperature)
public final boolean equals(java.lang.Object o)
Calculation
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
See www.degreedays.net/api/ for more about the Degree Days.net API.
You can sign up for a Degree Days.net API account and read the integration guide that is useful and applicable whether you are using Java or not.