Package com.storedobject.iot
Class MonthlyStatistics
- All Implemented Interfaces:
Displayable,StringFiller,DBTransaction.NoHistory,HasId
Represents a statistical record for a specific month. This class extends the
base
Statistics class and provides additional functionality to
handle and retrieve details specific to monthly data.
This class includes methods to define table columns and indices for database operations, along with getters and setters to manage and retrieve the month corresponding to the statistical data.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDefines a table column with the name "Month" and the data type "int".intgetMonth()Retrieves the month associated with this statistical record.intRetrieves the period associated with the monthly statistics.Retrieves a detailed representation of the period in the format "Month Year".Retrieves the type of period associated with this statistical data.static voidAdds database indices based on the specified column names and index type.next()Retrieves the next instance ofMonthlyStatistics, representing the subsequent month based on the current instance's month and year.previous()Retrieves theMonthlyStatisticsinstance for the previous month.voidsetMonth(int month) Sets the month value for this statistical record.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, validateDataMethods 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, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getActor, getAttachment, getAttachmentId, getChildren, getContemporaryOf, 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, listDeletedIds, 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, loadAttributesFrom, 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, 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
-
MonthlyStatistics
public MonthlyStatistics()Constructs a new instance ofMonthlyStatistics. This default constructor initializes theMonthlyStatisticsobject, which represents statistical data for a specific month. The instance can be further configured by setting the month and other properties as required.
-
-
Method Details
-
columns
Defines a table column with the name "Month" and the data type "int".- Parameters:
columns- an instance of the Columns class used to specify column definitions
-
indices
Adds database indices based on the specified column names and index type. This ensures that a unique compound index is created using the provided column names to optimize query performance.- Parameters:
indices- TheIndicesobject used to define new database indices.
-
setMonth
public void setMonth(int month) Sets the month value for this statistical record.- Parameters:
month- the month to set, represented as an integer (e.g., 1 for January, 12 for December)
-
getMonth
-
getPeriod
public int getPeriod()Retrieves the period associated with the monthly statistics. This method overrides the base class implementation to return the specific month value represented as an integer.- Specified by:
getPeriodin classStatistics<PeriodType>- Returns:
- the period as an integer, where the period corresponds to the month represented in the statistical record (e.g., 1 for January, 2 for February, etc.).
-
getPeriodDetail
Retrieves a detailed representation of the period in the format "Month Year". The method combines the name of the month (derived from a utility class) and the year associated with the instance.- Specified by:
getPeriodDetailin classStatistics<PeriodType>- Returns:
- a string representing the period detail in the format "Month Year".
-
previous
Retrieves theMonthlyStatisticsinstance for the previous month. If the current month is January, it will transition to December of the previous year.- Specified by:
previousin classStatistics<PeriodType>- Returns:
- a
MonthlyStatisticsinstance representing the statistics of the previous month.
-
next
Retrieves the next instance ofMonthlyStatistics, representing the subsequent month based on the current instance's month and year. If the month is December (12), the year is incremented, and the month is reset to January (1).- Specified by:
nextin classStatistics<PeriodType>- Returns:
- the next
MonthlyStatisticsobject corresponding to the following month.
-
getPeriodType
Retrieves the type of period associated with this statistical data. This method overrides the base class implementation and returns the specific period type asPeriodType.MONTHLY, indicating the statistics represent monthly data.- Specified by:
getPeriodTypein classStatistics<PeriodType>- Returns:
- the period type as
PeriodType.MONTHLY.
-