Package com.storedobject.iot
Class DailyStatistics
- All Implemented Interfaces:
Displayable
,StringFiller
,DBTransaction.NoHistory
,HasId
The DailyStatistics class represents daily statistical data and provides methods
to define column structure, indices, and retrieve specific daily statistics details.
This class extends the Statistics class and focuses on representing statistics
for a particular day within a given year.
This class is immutable and final, ensuring that its behavior does not change via inheritance.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Defines the column structure for daily statistics.int
getDay()
Retrieves the day of the month represented by this instance.int
Retrieves the period associated with this instance, represented by the day of the year.Retrieves detailed period information for a specific day within a given year.Retrieves the type of period represented by this instance.static void
Configures the indices structure for the DailyStatistics class by adding a compound index on the columns "Unit", "Name", "Year", and "Day".next()
Retrieves the next DailyStatistics instance for the subsequent day.previous()
Retrieves the previous day's statistics relative to the current instance.void
setDay
(int day) Sets the day value for the daily statistics.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
-
DailyStatistics
public DailyStatistics()Default constructor for the DailyStatistics class. Initializes a new instance of the DailyStatistics class, which represents daily statistical data for a specific day in a given year. The object created is immutable and focuses on handling statistics at the daily level.
-
-
Method Details
-
columns
Defines the column structure for daily statistics.- Parameters:
columns
- the Columns instance where the column definitions are added. This includes column names and their corresponding data types.
-
indices
Configures the indices structure for the DailyStatistics class by adding a compound index on the columns "Unit", "Name", "Year", and "Day".- Parameters:
indices
- the Indices instance where the compound index will be added
-
setDay
public void setDay(int day) Sets the day value for the daily statistics.- Parameters:
day
- the day of the year to set
-
getDay
-
getPeriod
public int getPeriod()Retrieves the period associated with this instance, represented by the day of the year.- Specified by:
getPeriod
in classStatistics<PeriodType>
- Returns:
- the day of the year as an integer.
-
getPeriodDetail
Retrieves detailed period information for a specific day within a given year. This method utilizes the DailyConsumption's periodDetail logic to compute the period-specific detail string, such as a formatted date.- Specified by:
getPeriodDetail
in classStatistics<PeriodType>
- Returns:
- a string representing the detailed period information for the day within the year.
-
previous
Retrieves the previous day's statistics relative to the current instance. If the current day is the first day of the year, it calculates the statistics for the last day of the previous year.- Specified by:
previous
in classStatistics<PeriodType>
- Returns:
- A
DailyStatistics
object representing the statistics for the previous day.
-
next
Retrieves the next DailyStatistics instance for the subsequent day. If the next day's data exists for the current year, it is returned. If not, and the current day is the last day of the year, it attempts to fetch the first day's data for the next year.- Specified by:
next
in classStatistics<PeriodType>
- Returns:
- the next DailyStatistics instance if available, or null if no data exists for the next day in the same year and it is not the end of the year.
-
getPeriodType
Retrieves the type of period represented by this instance.- Specified by:
getPeriodType
in classStatistics<PeriodType>
- Returns:
- the period type as an enumeration value. This method returns
PeriodType.DAILY
, indicating that the associated statistics pertain to daily data.
-