Package net.solarnetwork.domain.datum
Enum Class Aggregation
- All Implemented Interfaces:
Serializable,Comparable<Aggregation>,Constable
An aggregation level enumeration.
- Since:
- 2.7
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDay level aggregation.Aggregate by day of the week, e.g.Fifteen minute level aggregation.Five minute level aggregation.Hour level aggregation.Aggregate by hour of the day, e.g.Minute level aggregation.Month level aggregation.No aggregation.Aggregate all values into a single total result.Aggregate by day of the week per season.Aggregate by hour of the day per season.Ten minute level aggregation.Thirty minute level aggregation.Week level aggregation.Aggregate by week of the year, e.g.Year level aggregation. -
Method Summary
Modifier and TypeMethodDescriptionintcompareLevel(Aggregation other) Compare the level of this to another.static AggregationGet an enum instance for a key value.getKey()Get a key value.getLevel()Get the number of seconds the aggregation level represents.static AggregationReturns the enum constant of this class with the specified name.static Aggregation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
None
No aggregation.- Since:
- 1.6
-
Minute
Minute level aggregation. -
FiveMinute
Five minute level aggregation. -
TenMinute
Ten minute level aggregation. -
FifteenMinute
Fifteen minute level aggregation. -
ThirtyMinute
Thirty minute level aggregation.- Since:
- 1.5
-
Hour
Hour level aggregation. -
HourOfDay
Aggregate by hour of the day, e.g. compare 12-1pm across multiple days. -
SeasonalHourOfDay
Aggregate by hour of the day per season. -
Day
Day level aggregation. -
DayOfWeek
Aggregate by day of the week, e.g. compare Mondays against Tuesdays across multiple weeks. -
SeasonalDayOfWeek
Aggregate by day of the week per season. -
Week
Week level aggregation. -
WeekOfYear
Aggregate by week of the year, e.g. compare Week 1's against Week 2's across multiple years. -
Month
Month level aggregation. -
Year
Year level aggregation.- Since:
- 1.6
-
RunningTotal
Aggregate all values into a single total result.- Since:
- 1.4
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
compareLevel
Compare the level of this to another.- Parameters:
other- the other- Returns:
- -1 if this level less than other level, 0 if levels are equal, or 1 if this level is greater than other level
-
getLevel
Get the number of seconds the aggregation level represents.For aggregation levels higher than
Daythe number of seconds are approximate, based on the following standardized periods:- Week - 7 days
- Month - 4 weeks (28 days)
- Year - 365 days
- Returns:
- the aggregation level
-
getKey
Get a key value.- Returns:
- the key
- Since:
- 1.6
-
forKey
Get an enum instance for a key value.- Parameters:
key- the key value; if null or empty thenNonewill be returned- Returns:
- the enum
- Throws:
IllegalArgumentException- ifkeyis not supported- Since:
- 1.6
-