Package net.solarnetwork.domain
Enum Class SkyCondition
- All Implemented Interfaces:
Serializable,Comparable<SkyCondition>,Constable,Bitmaskable
Enumeration of standard sky condition values.
- Since:
- 1.50
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface net.solarnetwork.domain.Bitmaskable
Bitmaskable.BitmaskableTypeSort -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionClear day.Cloudy.Drizzle.Dusty, sand storm.Fog.Hail.Hazy.Hurricane.Rain.Scattered clouds.Scattered showers.Scattered snow.Severe storm.Showers.Snow.Storm.Thunder.Tornado.Windy -
Field Summary
Fields inherited from interface net.solarnetwork.domain.Bitmaskable
SORT_BY_TYPE -
Method Summary
Modifier and TypeMethodDescriptionintGet the bit offset.static intbitmaskValue(Set<SkyCondition> conditions) Get a bitmask value out of a set of conditions.static voidClear the internal cache used when computingSet<SkyCondition>instances from bitmask values.static Set<SkyCondition>conditionsForBitmask(int mask) Convert a bitmask value into a set of conditions.static SkyConditionforCode(int code) Get an enum for a code value.intgetCode()Get the code for this condition.static SkyConditionReturns the enum constant of this class with the specified name.static SkyCondition[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Clear
Clear day. -
ScatteredClouds
Scattered clouds. -
Cloudy
Cloudy. -
Fog
Fog. -
Drizzle
Drizzle. -
ScatteredShowers
Scattered showers. -
Showers
Showers. -
Rain
Rain. -
Hail
Hail. -
ScatteredSnow
Scattered snow. -
Snow
Snow. -
Storm
Storm. -
SevereStorm
Severe storm. -
Thunder
Thunder. -
Windy
Windy -
Hazy
Hazy. -
Tornado
Tornado. -
Hurricane
Hurricane. -
Dusty
Dusty, sand storm.
-
-
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
-
getCode
public int getCode()Get the code for this condition.- Returns:
- the code
-
bitmaskBitOffset
public int bitmaskBitOffset()Description copied from interface:BitmaskableGet the bit offset.- Specified by:
bitmaskBitOffsetin interfaceBitmaskable- Returns:
- offset, starting from 0 for the right-most bit
-
forCode
Get an enum for a code value.- Parameters:
code- the code to get an enum for- Returns:
- the enum with the given
code, or null ifcodeis 0 - Throws:
IllegalArgumentException- ifcodeis not supported
-
bitmaskValue
Get a bitmask value out of a set of conditions.- Parameters:
conditions- the set of conditions (null allowed)- Returns:
- the bitmask
- See Also:
-
conditionsForBitmask
Convert a bitmask value into a set of conditions.This method maintains a cache of results to help reduce the number of runtime objects needed.
- Parameters:
mask- a bitmask value of a set of condition codes- Returns:
- an immutable set of conditions, never null
- See Also:
-
clearBitmaskCache
public static void clearBitmaskCache()Clear the internal cache used when computingSet<SkyCondition>instances from bitmask values.
-