Package com.storedobject.iot
Class HourlyStatistics
- All Implemented Interfaces:
Displayable
,StringFiller
,DBTransaction.NoHistory
,HasId
The HourlyStatistics class extends the Statistics class and adds functionality specific to hourly data.
It represents statistical information associated with a particular hour of the year.
This class provides methods to set, retrieve, and manipulate the hour-related data and period-specific details.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Configures the columns by adding a column with the name "Hour" and type "int".int
getHour()
Retrieves the hour associated with this HourlyStatistics instance.int
Retrieves the period associated with this instance, which corresponds to the hour value.Retrieves the detailed representation of the period associated with this instance.Retrieves the type of period for the current statistics instance.static void
Configures the given Indices object by adding an index with the specified keys.next()
Retrieves the next HourlyStatistics instance based on the current hour and year.previous()
Retrieves the HourlyStatistics instance corresponding to the previous hour.void
setHour
(int hour) Sets the hour for the HourlyStatistics object.Methods inherited from class com.storedobject.iot.Statistics
add, add, getCount, getMax, getMean, getMin, getName, getPeriodName, getSD, getUnit, getUnitId, getYear, setCount, setMax, setMean, setMin, setName, setSD, setUnit, setUnit, setUnit, setYear, toDisplay, validateData
Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
HourlyStatistics
public HourlyStatistics()Constructs a new instance of HourlyStatistics. This constructor initializes an object that represents statistical data corresponding to a specific hour of the year.
-
-
Method Details
-
columns
Configures the columns by adding a column with the name "Hour" and type "int".- Parameters:
columns
- the Columns object used to define and store column information
-
indices
Configures the given Indices object by adding an index with the specified keys.- Parameters:
indices
- the Indices object to which the index will be added
-
setHour
public void setHour(int hour) Sets the hour for the HourlyStatistics object.- Parameters:
hour
- the hour to be set, typically represented as an integer ranging from 0 to 23, where 0 represents midnight and 23 represents 11 PM.
-
getHour
-
getPeriod
public int getPeriod()Retrieves the period associated with this instance, which corresponds to the hour value.- Specified by:
getPeriod
in classStatistics<PeriodType>
- Returns:
- the hour of the year as an integer, representing the period.
-
getPeriodDetail
Retrieves the detailed representation of the period associated with this instance. For the HourlyStatistics class, this method provides a formatted string representing the hour-specific period details.- Specified by:
getPeriodDetail
in classStatistics<PeriodType>
- Returns:
- a string representing the formatted period details, including the hour component.
-
previous
Retrieves the HourlyStatistics instance corresponding to the previous hour. If the current hour is the first hour of the year (hour 0 of day 1), this method calculates the statistics for the last hour of the previous year.- Specified by:
previous
in classStatistics<PeriodType>
- Returns:
- the HourlyStatistics object representing the previous hour's statistics.
-
next
Retrieves the next HourlyStatistics instance based on the current hour and year. The method increments the current hour, retrieves the corresponding data, and if no data exists for the incremented hour within the same year, it progresses to the next year starting from hour 1. If no further data is available, it returns null.- Specified by:
next
in classStatistics<PeriodType>
- Returns:
- the next HourlyStatistics instance if available; otherwise, null.
-
getPeriodType
Retrieves the type of period for the current statistics instance. For the HourlyStatistics class, this method always returns PeriodType.HOURLY, indicating hourly granularity for statistical data.- Specified by:
getPeriodType
in classStatistics<PeriodType>
- Returns:
- the period type, which is always PeriodType.HOURLY for this implementation.
-