|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.data.Breakdown
net.degreedays.api.data.AverageBreakdown
net.degreedays.api.data.impl.FullYearsAverageBreakdown
public final class FullYearsAverageBreakdown
A type of AverageBreakdown
used to specify that average-degree-day
figures should be derived from data covering a specified number of full
calendar years. The years used will always be consecutive (i.e. no gaps), and
are specified using the Period
passed into the constructor.
Typically you'd want to use Period.latestValues(int)
to create the
Period
, to specify that the last year of the average should be
the most recent full calendar year.
If you want average data calculated using a different method, remember that you can always fetch dated data and calculate averages directly from that.
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Constructor Summary | |
---|---|
FullYearsAverageBreakdown(Period period)
Constructs a FullYearsAverageBreakdown object that specifies
average degree days derived from data covering full calendar years
determined by the specified period . |
Method Summary | |
---|---|
DayRange |
getFullRangeOrNull(DayRange availableDataRange)
Returns the range of days that this breakdown would cover given source data covering availableDataRange , or null if
availableDataRange would not be enough for this breakdown. |
Period |
period()
Returns the non-null period in time that the breakdown should average data from. |
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.AverageBreakdown |
---|
fullYears |
Methods inherited from class net.degreedays.api.data.Breakdown |
---|
equals, hashCode |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FullYearsAverageBreakdown(Period period)
FullYearsAverageBreakdown
object that specifies
average degree days derived from data covering full calendar years
determined by the specified period
.
period
- specifying the full calendar years of data that the average
figures should be derived from. Cannot be null. Typically you'd
want to use Period.latestValues(int)
for this, specifying at
least 2 values (since an average of 1 year of data is not very
meaningful). But you can also use Period.dayRange(net.degreedays.time.DayRange)
- in
this case the period may be widened for calculation
purposes to make it cover full calendar years.
java.lang.NullPointerException
- if period
is null.Method Detail |
---|
public Period period()
public DayRange getFullRangeOrNull(DayRange availableDataRange)
availableDataRange
, or null
if
availableDataRange
would not be enough for this breakdown.
getFullRangeOrNull
in class Breakdown
availableDataRange
- the non-null range of temperature data
available (or the available range of daily degree-day data if
summing daily degree days into a different breakdown).
java.lang.NullPointerException
- if availableDataRange
is
null.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 |