Enum Class SkyCondition

java.lang.Object
java.lang.Enum<SkyCondition>
net.solarnetwork.domain.SkyCondition
All Implemented Interfaces:
Serializable, Comparable<SkyCondition>, Constable, Bitmaskable

public enum SkyCondition extends Enum<SkyCondition> implements Bitmaskable
Enumeration of standard sky condition values.
Since:
1.50
Version:
1.0
Author:
matt
  • Enum Constant Details

    • Clear

      public static final SkyCondition Clear
      Clear day.
    • ScatteredClouds

      public static final SkyCondition ScatteredClouds
      Scattered clouds.
    • Cloudy

      public static final SkyCondition Cloudy
      Cloudy.
    • Fog

      public static final SkyCondition Fog
      Fog.
    • Drizzle

      public static final SkyCondition Drizzle
      Drizzle.
    • ScatteredShowers

      public static final SkyCondition ScatteredShowers
      Scattered showers.
    • Showers

      public static final SkyCondition Showers
      Showers.
    • Rain

      public static final SkyCondition Rain
      Rain.
    • Hail

      public static final SkyCondition Hail
      Hail.
    • ScatteredSnow

      public static final SkyCondition ScatteredSnow
      Scattered snow.
    • Snow

      public static final SkyCondition Snow
      Snow.
    • Storm

      public static final SkyCondition Storm
      Storm.
    • SevereStorm

      public static final SkyCondition SevereStorm
      Severe storm.
    • Thunder

      public static final SkyCondition Thunder
      Thunder.
    • Windy

      public static final SkyCondition Windy
      Windy
    • Hazy

      public static final SkyCondition Hazy
      Hazy.
    • Tornado

      public static final SkyCondition Tornado
      Tornado.
    • Hurricane

      public static final SkyCondition Hurricane
      Hurricane.
    • Dusty

      public static final SkyCondition Dusty
      Dusty, sand storm.
  • Method Details

    • values

      public static SkyCondition[] 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

      public static SkyCondition valueOf(String name)
      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 name
      NullPointerException - 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: Bitmaskable
      Get the bit offset.
      Specified by:
      bitmaskBitOffset in interface Bitmaskable
      Returns:
      offset, starting from 0 for the right-most bit
    • forCode

      public static SkyCondition forCode(int code)
      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 if code is 0
      Throws:
      IllegalArgumentException - if code is not supported
    • bitmaskValue

      public static int bitmaskValue(Set<SkyCondition> conditions)
      Get a bitmask value out of a set of conditions.
      Parameters:
      conditions - the set of conditions (null allowed)
      Returns:
      the bitmask
      See Also:
    • conditionsForBitmask

      public static Set<SkyCondition> conditionsForBitmask(int mask)
      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 computing Set<SkyCondition> instances from bitmask values.