Package com.storedobject.iot
Class WeeklyStatistics
- All Implemented Interfaces:
Displayable
,StringFiller
,DBTransaction.NoHistory
,HasId
The WeeklyStatistics class extends the Statistics class and provides
functionality for managing and retrieving weekly statistical data.
This class includes methods to define database columns and indices,
as well as methods to get and set the week value of the statistics.
Additionally, it overrides methods to provide details about the
specific period (week) being represented.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds a column definition for the "Week" attribute of type "int" to the provided Columns object.int
Gets the period represented by the current instance of WeeklyStatistics.Retrieves a detailed representation of the specific period (week) for this instance, based on the year and week values.Retrieves the type of period associated with this instance of WeeklyStatistics.int
getWeek()
Retrieves the week value for the current instance of WeeklyStatistics.static void
Configures the database indices for the WeeklyStatistics table.next()
Retrieves the next week's statistics based on the current instance.previous()
Retrieves the WeeklyStatistics for the previous week relative to the current instance.void
setWeek
(int week) Sets the week value for the 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
-
WeeklyStatistics
public WeeklyStatistics()Default constructor for the WeeklyStatistics class. Initializes an instance of the WeeklyStatistics class, which is a specialized subclass of Statistics designed for handling statistical data on a weekly basis.
-
-
Method Details
-
columns
Adds a column definition for the "Week" attribute of type "int" to the provided Columns object.- Parameters:
columns
- the Columns object to which the "Week" column should be added
-
indices
Configures the database indices for the WeeklyStatistics table.- Parameters:
indices
- TheIndices
object used to define the indices for the table. This method adds an index on the columns "Unit, Name, Year, Week" with a specification to enforce uniqueness.
-
setWeek
public void setWeek(int week) Sets the week value for the statistics.- Parameters:
week
- the week number to set, representing the statistical period
-
getWeek
-
getPeriod
public int getPeriod()Gets the period represented by the current instance of WeeklyStatistics. In this implementation, the period corresponds to the specific week value.- Specified by:
getPeriod
in classStatistics<PeriodType>
- Returns:
- the week value representing the current period.
-
getPeriodDetail
Retrieves a detailed representation of the specific period (week) for this instance, based on the year and week values.- Specified by:
getPeriodDetail
in classStatistics<PeriodType>
- Returns:
- a string representing the detailed period, formatted as defined by the DailyConsumption.periodDetail method.
-
previous
Retrieves the WeeklyStatistics for the previous week relative to the current instance. If the current week is the first week of the year (week 1), this method adjusts the year and week values to point to the last week (week 52) of the previous year.- Specified by:
previous
in classStatistics<PeriodType>
- Returns:
- the WeeklyStatistics object representing the previous week's data.
-
next
Retrieves the next week's statistics based on the current instance. If the current week is the last week of the year (week 53), the method transitions to the first week of the next year.- Specified by:
next
in classStatistics<PeriodType>
- Returns:
- an instance of
WeeklyStatistics
representing the statistics for the next week.
-
getPeriodType
Retrieves the type of period associated with this instance of WeeklyStatistics. Specifically, this method indicates that the statistical data is organized and represented on a weekly basis.- Specified by:
getPeriodType
in classStatistics<PeriodType>
- Returns:
- the PeriodType for this instance, which is
PeriodType.WEEKLY
.
-