Enum HotColdTemperature

    • Method Detail

      • values

        public static HotColdTemperature[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HotColdTemperature c : HotColdTemperature.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HotColdTemperature valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getFromTemperatureSet

        public static HotColdTemperature getFromTemperatureSet​(Set<HotColdTemperature> temperatureSet,
                                                               String message)
        Gets the temperature from a set of temperatures corresponding to the passed string.
        temperatureSet - A set of temperature values to select from
        message - A string containing a temperature value
        The corresponding enum from the given temperature set.

        Note that in cases where two temperature values in the given set are equally likely to be the given temperature (say, two temperatures with identical text values), the behavior is undefined.

      • getText

        public String getText()
      • getMinDistance

        public int getMinDistance()
      • getMaxDistance

        public int getMaxDistance()