|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.data.DataSet
net.degreedays.api.data.AverageDataSet
public final class AverageDataSet
Contains a set of average degree-day data generated to fulfil an
AverageDataSpec
for a specific Location
.
DatedDataSet
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Nested Class Summary | |
---|---|
static class |
AverageDataSet.Builder
A builder class for creating immutable AverageDataSet objects
e.g. for testing purposes. |
Method Summary | |
---|---|
DataValue |
annualAverage()
Returns the non-null average annual value. |
boolean |
equals(java.lang.Object o)
Returns true if o is an
AverageDataSet containing equal values and calculated from
data covering an equal period in time. |
int |
firstYear()
Returns the first year of the continuous set of data that was used to calculate the average figures. |
DayRange |
fullRange()
Returns a non-null DayRange object indicating the period of
data from which this AverageDataSet 's figures were
calculated. |
int |
hashCode()
Overridden to ensure consistency with equals . |
int |
lastYear()
Returns the last year of the continuous set of data that was used to calculate the average figures. |
DataValue |
monthlyAverage(int monthIndexWithJanAs1)
Returns the non-null average value for the specified month (e.g. pass 1 for the average value for the month of January). |
int |
numberOfYears()
Returns the number of years of data that the average figures were calculated from (e.g. for 5-year-average data this would return 5). |
double |
percentageEstimated()
Returns a number between 0 and 100 (both inclusive), indicating the overall extent to which this DataSet is based on estimated
data. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public double percentageEstimated()
DataSet
DataSet
is based on estimated
data.
Generally speaking, data with a lower percentage-estimated figure is likely to be more reliable than data with a higher percentage-estimated figure.
percentageEstimated
in class DataSet
public DayRange fullRange()
DayRange
object indicating the period of
data from which this AverageDataSet
's figures were
calculated. The returned object will range from the first of January on
the firstYear()
to the 31st of December on the
lastYear()
.
fullRange
in class DataSet
public int firstYear()
public int lastYear()
public int numberOfYears()
public DataValue monthlyAverage(int monthIndexWithJanAs1)
monthIndexWithJanAs1
- a number between 1 (for January) and 12 (for
December).
java.lang.IndexOutOfBoundsException
- if monthIndexWithJanAs1
is
less than 1 or greater than 12.public DataValue annualAverage()
public boolean equals(java.lang.Object o)
true
if o
is an
AverageDataSet
containing equal values and calculated from
data covering an equal period in time.
equals
in class java.lang.Object
public int hashCode()
equals
.
hashCode
in class java.lang.Object
public java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |