public abstract class TimeSeriesDataValue extends DataValue
Contains a value (e.g. a temperature value) for a specific point in time, and an approximate indication of its accuracy.
TimeSeriesDataSet
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.
Modifier and Type | Method and Description |
---|---|
Day |
day()
Returns a non-null
Day object indicating the YYYY-MM-DD date
that this TimeSeriesDataValue falls on in the local
time-zone of the weather station. |
int |
dayOfMonth()
Returns a number between 1 and 31 (inclusive) indicating the
day of the month that this
TimeSeriesDataValue falls on in
the local time-zone of the weather station. |
DayOfWeek |
dayOfWeek()
Returns a non-null
DayOfWeek object indicating the day of
the week that this TimeSeriesDataValue falls on in the local
time-zone of the weather station. |
int |
dayOfYear()
Returns a number between 1 and 366 inclusive (365 for non-leap years)
indicating the day of the year that this
TimeSeriesDataValue
falls on in the local time-zone of the weather station. |
DayTime |
dayTime()
Returns a non-null
DayTime object indicating the
YYYY-MM-DDThh:mm date-time of this TimeSeriesDataValue in
the local time-zone of the weather station. |
boolean |
equals(java.lang.Object o)
Returns
true if o is a
TimeSeriesDataValue object with an equal
value() ,
percentageEstimated() , and
offsetDayTime() ; false otherwise. |
int |
hashCode()
Overridden to ensure consistency with
equals . |
int |
hour()
Returns a number between 0 and 23 (inclusive) indicating the hour of the
day that this
TimeSeriesDataValue falls in in the local
time-zone of the weather station. |
int |
minute()
Returns a number between 0 and 59 (inclusive) indicating the minute of
the hour that this
TimeSeriesDataValue falls in in the local
time-zone of the weather station. |
int |
monthOfYear()
Returns a number between 1 (January) and 12 (December) indicating the
month of the year that this
TimeSeriesDataValue falls in in
the local time-zone of the weather station. |
static TimeSeriesDataValue |
of(double value,
double percentageEstimated,
OffsetDayTime offsetDayTime)
Returns a non-null
TimeSeriesDataValue object with the
specified value, percentage estimated, and date-time. |
abstract OffsetDayTime |
offsetDayTime()
Returns a non-null
OffsetDayTime object indicating the
YYYY-MM-DDThh:mm date-time of this TimeSeriesDataValue , both
in the local time-zone of the weather station, and relative to UTC. |
int |
offsetTotalMinutes()
Returns the total number of minutes by which the date-time of this
TimeSeriesDataValue (in the local time zone of the weather
station) is offset from UTC. |
Time |
time()
Returns a non-null
Time object indicating the hh:mm time of
this TimeSeriesDataValue in the local time-zone of the
weather station. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.
|
int |
year()
Returns a number indicating the year that this
TimeSeriesDataValue falls in in the local time-zone of the
weather station. |
of, percentageEstimated, value
public abstract OffsetDayTime offsetDayTime()
OffsetDayTime
object indicating the
YYYY-MM-DDThh:mm date-time of this TimeSeriesDataValue
, both
in the local time-zone of the weather station, and relative to UTC.
This holds the full detail of the date-time associated with this
TimeSeriesDataValue
, including its time-zone info. All the
other time-related properties of this class are just shortcuts to the
various components of this OffsetDayTime
.
public final DayTime dayTime()
DayTime
object indicating the
YYYY-MM-DDThh:mm date-time of this TimeSeriesDataValue
in
the local time-zone of the weather station.
This is simply a shortcut for the dayTime()
property of
offsetDayTime()
.
public final int offsetTotalMinutes()
TimeSeriesDataValue
(in the local time zone of the weather
station) is offset from UTC.
For example, for a TimeSeriesDataValue
with a date-time of
2020-08-15T11:43+01:00 this would return 60, and for one with a date-time
of 2020-08-15T11:43-05:00 it would return -300.
This is simply a shortcut for the offsetTotalMinutes()
property of offsetDayTime()
.
public final Day day()
Day
object indicating the YYYY-MM-DD date
that this TimeSeriesDataValue
falls on in the local
time-zone of the weather station.
This is simply a shortcut for the day()
property of
offsetDayTime()
.
public final Time time()
Time
object indicating the hh:mm time of
this TimeSeriesDataValue
in the local time-zone of the
weather station.
This is simply a shortcut for the time()
property of
offsetDayTime()
.
public final int year()
TimeSeriesDataValue
falls in in the local time-zone of the
weather station.
This is simply a shortcut for the year()
property of
offsetDayTime()
.
public final int monthOfYear()
TimeSeriesDataValue
falls in in
the local time-zone of the weather station.
This is simply a shortcut for the monthOfYear()
property of
offsetDayTime()
.
public final int dayOfMonth()
TimeSeriesDataValue
falls on in
the local time-zone of the weather station.
This is simply a shortcut for the dayOfMonth()
property of
offsetDayTime()
.
public DayOfWeek dayOfWeek()
DayOfWeek
object indicating the day of
the week that this TimeSeriesDataValue
falls on in the local
time-zone of the weather station.
This is simply a shortcut for the dayOfWeek()
property of
offsetDayTime()
.
public int dayOfYear()
TimeSeriesDataValue
falls on in the local time-zone of the weather station.
This is simply a shortcut for the dayOfYear()
property of
offsetDayTime()
.
public final int hour()
TimeSeriesDataValue
falls in in the local
time-zone of the weather station.
This is simply a shortcut for the hour()
property of
offsetDayTime()
.
public final int minute()
TimeSeriesDataValue
falls in in the local
time-zone of the weather station.
This is simply a shortcut for the minute()
property of
offsetDayTime()
.
public final boolean equals(java.lang.Object o)
true
if o
is a
TimeSeriesDataValue
object with an equal
value()
,
percentageEstimated()
, and
offsetDayTime()
; false
otherwise.public final int hashCode()
equals
.public final java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
public static TimeSeriesDataValue of(double value, double percentageEstimated, OffsetDayTime offsetDayTime)
TimeSeriesDataValue
object with the
specified value, percentage estimated, and date-time.value
- indicating the value to be held by the returned object (e.g.
the temperature value).percentageEstimated
- a number, greater than or equal to zero and
less than or equal to 100, indicating the extent to which the
value
is based on estimated data.offsetDayTime
- the date-time of the time-series value. Cannot be
null
.java.lang.IllegalArgumentException
- if value
or
percentageEstimated
is NaN
or infinity,
or if percentageEstimated
is less than 0 or greater
than 100.java.lang.NullPointerException
- if offsetDayTime
is
null
.
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.