public static final class AverageDataSet.Builder
extends java.lang.Object
AverageDataSet
objects
e.g. for testing purposes.Instances of this builder class are designed for single-threaded use only. It's fine to create and use instances in multiple concurrent threads, but, in the absence of external synchronization, the use of each individual builder instance should be restricted to one thread only.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AverageDataSet |
build() |
AverageDataSet.Builder |
setAnnualAverage(DataValue annualAverage) |
AverageDataSet.Builder |
setFirstYear(int firstYear) |
AverageDataSet.Builder |
setLastYear(int lastYear) |
AverageDataSet.Builder |
setMonthlyAverage(int monthIndexWithJanAs1,
DataValue monthlyAverage)
Sets the average value for the specified month (January having index
1).
|
public AverageDataSet.Builder setFirstYear(int firstYear)
public AverageDataSet.Builder setLastYear(int lastYear)
public AverageDataSet.Builder setMonthlyAverage(int monthIndexWithJanAs1, DataValue monthlyAverage)
monthIndexWithJanAs1
- a number between 1 (for January) and 12
(for December).monthlyAverage
- the monthly-average value to set.this
, for method chaining.java.lang.IndexOutOfBoundsException
- if
monthIndexWithJanAs1
is less than 1 or greater
than 12.java.lang.NullPointerException
- if monthlyAverage
is
null
.public AverageDataSet.Builder setAnnualAverage(DataValue annualAverage)
public AverageDataSet build()
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.