|
||||||||||
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.DatedBreakdown
net.degreedays.api.data.impl.MonthlyBreakdown
public final class MonthlyBreakdown
A type of DatedBreakdown
used to specify that degree days should be
broken down on a monthly basis and cover a specific Period
in time.
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Constructor Summary | |
---|---|
MonthlyBreakdown(Period period)
Constructs a MonthlyBreakdown object that specifies monthly
degree days covering the specified period in time and broken
down according to regular calendar months. |
|
MonthlyBreakdown(Period period,
StartOfMonth startOfMonth)
Constructs a MonthlyBreakdown object that specifies monthly
degree days covering the specified period in time, with each
"month" starting on the specified day of the month. |
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 monthly breakdown should cover. |
StartOfMonth |
startOfMonth()
Returns a non-null StartOfMonth object indicating which day
should be taken as the first of each month (inclusive). |
MaybeEmptyDayRanges |
toDayRanges(DayRange availableDataRange)
Returns the breakdown in terms of the day ranges that would constitute it given source data covering availableDataRange . |
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.DatedBreakdown |
---|
daily, monthly, monthly, weekly, yearly, yearly |
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 MonthlyBreakdown(Period period, StartOfMonth startOfMonth)
MonthlyBreakdown
object that specifies monthly
degree days covering the specified period
in time, with each
"month" starting on the specified day of the month.
period
- the period in time that the monthly breakdown should cover.
Cannot be null.startOfMonth
- specifying which day (between 1 and 28 inclusive)
should be taken as the first of each "month". Pass
StartOfMonth.of(1)
to specify regular calendar
months. Cannot be null.
java.lang.NullPointerException
- if period
or
startOfMonth
is null.public MonthlyBreakdown(Period period)
MonthlyBreakdown
object that specifies monthly
degree days covering the specified period
in time and broken
down according to regular calendar months.
This is a shortcut version of
this constructor
that specifies the first day of the month as the
startOfMonth
parameter.
period
- the period in time that the monthly breakdown should cover.
Cannot be null.
java.lang.NullPointerException
- if period
is null
.Method Detail |
---|
public Period period()
public StartOfMonth startOfMonth()
StartOfMonth
object indicating which day
should be taken as the first of each month (inclusive).
public MaybeEmptyDayRanges toDayRanges(DayRange availableDataRange)
availableDataRange
.
If you call fullRangeOrNull()
on the return value, you'll get the same result that
you'd get by calling getFullRangeOrNull(availableDataRange)
on this object. Essentially this
method is a more detailed version of getFullRangeOrNull
that
makes sense for dated breakdowns, which translate to real ranges of days
on a calendar (unlike average breakdowns which are broken down into
months of an "average year" rather than applying to a real calendar).
toDayRanges
in class DatedBreakdown
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 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 |