Class RangeOption

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<FreeColObject>, ObjectWithId, Option<java.lang.Integer>

    public class RangeOption
    extends SelectOption
    Represents an option where the valid choice is an integer and the choices are represented by strings. In general, these strings are localized by looking up the key of the choice, which consists of the identifier of the AbstractObject followed by a "." followed by the value of the option string. RangeOption differs from SelectOption, as the value being selected represents a numeric measurement, defined by a bounded range of comparable values. As the graphical component rendering a range option only works with a conventional index, this implies to manage a fixed rank for each possible values.
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
    • Constructor Detail

      • RangeOption

        public RangeOption​(Specification specification)
        Creates a new RangeOption.
        Parameters:
        specification - The Specification to refer to.
      • RangeOption

        public RangeOption​(java.lang.String id,
                           Specification specification)
        Creates a new RangeOption.
        Parameters:
        id - The object identifier.
        specification - The Specification to refer to.
    • Method Detail

      • getValueRank

        public int getValueRank()
        Gets the rank of the current selected value in the list of values of this RangeOption.
        Returns:
        The value.
      • setValueRank

        public void setValueRank​(int rank)
        Sets the value through the rank in the list of values of this RangeOption.
        Parameters:
        rank - The rank of the value to be set.
      • getXMLItemElementTagName

        public java.lang.String getXMLItemElementTagName()
        Gets the tag name of the contained object.
        Overrides:
        getXMLItemElementTagName in class SelectOption
        Returns:
        "rangeValue".
      • getXMLTagName

        public java.lang.String getXMLTagName()
        Get the serialization tag for this object.
        Overrides:
        getXMLTagName in class SelectOption
        Returns:
        The tag.