|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.data.Calculation
public abstract class Calculation
Defines how degree days should be calculated e.g. HDD or CDD to a specific base temperature.
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.
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |