Package com.storedobject.iot
Class DataSet.DataStatus<V>
java.lang.Object
com.storedobject.iot.DataSet.DataStatus<V>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DataStatus
(Unit unit, ValueDefinition<V> valueDefinition) -
Method Summary
Modifier and TypeMethodDescriptionabstract int
alarm()
Get the alarm level associated with the current data status.final boolean
alert()
Determines whether the current data status condition should trigger an alert.final String
caption()
Retrieves the caption associated with the current data status.Retrieves the daily statistics associated with the current data status.display()
Generates a formatted string that represents the current data status.final boolean
long
Retrieve the time at which the alarm condition was last triggered.Get the alarm message associated with the current alarm condition.final long
getId()
Retrieves the unique identifier associated with the current data status.final Unit
getUnit()
Retrieves the unit associated with the current data status.abstract V
getValue()
Retrieves the value associated with the current data status.Retrieves the value definition associated with the current data status.final int
hashCode()
Retrieves the hourly statistics associated with the current data status.final String
label()
Retrieves the label associated with the current data status.Retrieves the monthly statistics associated with the current data status.int
Retrieves the ordinality of the current data status.final int
Retrieves the significance level associated with the current data status.abstract String
Retrieves the status label associated with the current data status.final String
tooltip()
Retrieves the tooltip information associated with the current data status.abstract String
value()
Retrieves the string representation of the value associated with the current data status.value
(double value, boolean showUnit) Retrieves the string representation of the specified value, optionally including the unit.Retrieves the string representation of the value associated with the specified attribute for the current data status.Retrieves the weekly statistics associated with the current data status.Retrieves the yearly statistics associated with the current data status.
-
Field Details
-
alarmAt
protected long alarmAt
-
-
Constructor Details
-
DataStatus
-
-
Method Details
-
getUnit
-
getValueDefinition
Retrieves the value definition associated with the current data status.- Returns:
- the
ValueDefinition
object representing the value definition.
-
significance
public final int significance()Retrieves the significance level associated with the current data status.- Returns:
- an integer representing the significance value defined in the associated
ValueDefinition
.
-
alarm
public abstract int alarm()Get the alarm level associated with the current data status. This method is intended to be implemented by subclasses to provide the specific logic for handling alarm conditions.- Returns:
- an integer representing the alarm level or code, which is defined and interpreted by the implementing class.
-
alert
public final boolean alert()Determines whether the current data status condition should trigger an alert. The alert condition depends on the alert flag from the value definition and whether the alarm level is non-zero.- Returns:
- true if the alert flag is enabled in the value definition and the alarm level is non-zero, otherwise false.
-
statusLabel
Retrieves the status label associated with the current data status. This method is intended to provide a human-readable representation or description of the status, typically implemented by subclasses.- Returns:
- a string representing the status label of the data status.
-
caption
Retrieves the caption associated with the current data status. The caption is determined based on the unit and value definition.- Returns:
- a string representing the caption of the data status.
-
label
Retrieves the label associated with the current data status. The label is determined based on the unit and its corresponding value definition.- Returns:
- a string representing the label of the data status.
-
tooltip
Retrieves the tooltip information associated with the current data status. The tooltip is derived based on the unit and its corresponding value definition.- Returns:
- a string representing the tooltip of the data status.
-
value
Retrieves the string representation of the value associated with the current data status. This method is intended to be implemented by subclasses to provide specific value formatting or logic.- Returns:
- a string representing the value of the data status.
-
value
Retrieves the string representation of the value associated with the specified attribute for the current data status.- Parameters:
attribute
- the attribute for which the value needs to be retrieved- Returns:
- a string representing the value of the specified attribute
-
value
Retrieves the string representation of the specified value, optionally including the unit.- Parameters:
value
- the numerical value to be converted to a string representationshowUnit
- a boolean flag indicating whether the unit should be included in the output- Returns:
- a string representing the value, with or without the unit depending on the showUnit parameter
-
hourlyStatistics
Retrieves the hourly statistics associated with the current data status.- Returns:
- the
HourlyStatistics
object representing data specific to hourly intervals, obtained using the name from the value definition.
-
dailyStatistics
Retrieves the daily statistics associated with the current data status. The daily statistics object is obtained based on the name from the value definition.- Returns:
- the
DailyStatistics
object representing daily statistics for the associated unit and value definition.
-
weeklyStatistics
Retrieves the weekly statistics associated with the current data status. This method fetches theWeeklyStatistics
object using the name from the associated value definition of the unit.- Returns:
- the
WeeklyStatistics
object representing data specific to weekly intervals for the corresponding unit and value definition.
-
monthlyStatistics
Retrieves the monthly statistics associated with the current data status. The statistics are determined based on the name from the value definition and are specific to monthly intervals.- Returns:
- the
MonthlyStatistics
object representing data for monthly intervals, obtained using the name from the value definition and associated logic in the unit.
-
yearlyStatistics
Retrieves the yearly statistics associated with the current data status. The yearly statistics object is determined using the name from the associated value definition and fetched through the unit's logic.- Returns:
- the
YearlyStatistics
object representing data specific to yearly intervals for the corresponding unit and value definition.
-
getValue
Retrieves the value associated with the current data status.- Returns:
- the value of type V as defined by the subclass implementation.
-
display
Generates a formatted string that represents the current data status. The output string combines the alarm level symbol, the associated caption, and the value for the data status.
The alarm level determines the symbol to be displayed: - 3 -> ⇈ - 2 -> ↟ - 1 -> ↑ - -1 -> ↓ - -2 -> ↡ - -3 -> ⇊ - default -> "-"
The caption is derived from the associated value definition and the unit. The value is obtained from the implementation provided by the subclass.- Returns:
- a string representation of the data status formatted as "[Alarm Symbol] [Caption]: [Value]".
-
equals
-
hashCode
-
getId
public final long getId()Retrieves the unique identifier associated with the current data status.- Returns:
- a long value representing the unique identifier.
-
ordinality
public int ordinality()Retrieves the ordinality of the current data status. The ordinality is determined by the associated unit's ordinality value.- Returns:
- an integer representing the ordinality as defined by the associated
Unit
.
-
getAlarmMessage
Get the alarm message associated with the current alarm condition.- Returns:
- Alarm message.
-
getAlarmAt
public long getAlarmAt()Retrieve the time at which the alarm condition was last triggered.- Returns:
- The time at which the alarm condition was last triggered.
-