net.degreedays.api.data
Class TimeSeriesDataValue

java.lang.Object
  extended by net.degreedays.api.data.DataValue
      extended by net.degreedays.api.data.TimeSeriesDataValue

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.

Since:
1.2
See Also:
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.


Method Summary
 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.
 
Methods inherited from class net.degreedays.api.data.DataValue
of, percentageEstimated, value
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

offsetDayTime

public 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.

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.


dayTime

public final 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.

This is simply a shortcut for the dayTime() property of offsetDayTime().


offsetTotalMinutes

public final 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.

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().


day

public final 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.

This is simply a shortcut for the day() property of offsetDayTime().


time

public final 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.

This is simply a shortcut for the time() property of offsetDayTime().


year

public final int year()
Returns a number indicating the year that this TimeSeriesDataValue falls in in the local time-zone of the weather station.

This is simply a shortcut for the year() property of offsetDayTime().


monthOfYear

public final 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.

This is simply a shortcut for the monthOfYear() property of offsetDayTime().


dayOfMonth

public final 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.

This is simply a shortcut for the dayOfMonth() property of offsetDayTime().


dayOfWeek

public 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.

This is simply a shortcut for the dayOfWeek() property of offsetDayTime().


dayOfYear

public 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.

This is simply a shortcut for the dayOfYear() property of offsetDayTime().


hour

public final 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.

This is simply a shortcut for the hour() property of offsetDayTime().


minute

public final 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.

This is simply a shortcut for the minute() property of offsetDayTime().


equals

public final boolean equals(java.lang.Object o)
Returns true if o is a TimeSeriesDataValue object with an equal value(), percentageEstimated(), and offsetDayTime(); false otherwise.

Overrides:
equals in class DataValue

hashCode

public final int hashCode()
Overridden to ensure consistency with equals.

Overrides:
hashCode in class DataValue

toString

public final java.lang.String toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes.

The exact details of the representation are unspecified and subject to change.

Overrides:
toString in class DataValue

of

public static TimeSeriesDataValue of(double value,
                                     double percentageEstimated,
                                     OffsetDayTime offsetDayTime)
Returns a non-null TimeSeriesDataValue object with the specified value, percentage estimated, and date-time.

Parameters:
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.
Throws:
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.


www.degreedays.net/api/