Class EnumeratedAttribute

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String value
      The selected value in this enumeration.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected EnumeratedAttribute()
      bean constructor
    • Field Detail

      • value

        protected java.lang.String value
        The selected value in this enumeration.
    • Constructor Detail

      • EnumeratedAttribute

        protected EnumeratedAttribute()
        bean constructor
    • Method Detail

      • getValues

        public abstract java.lang.String[] getValues()
        This is the only method a subclass needs to implement.
        Returns:
        an array holding all possible values of the enumeration. The order of elements must be fixed so that indexOfValue(String) always return the same index for the same value.
      • setValue

        public void setValue​(java.lang.String value)
                      throws BuildException
        Parameters:
        value - the String value of the attribute
        Throws:
        BuildException - if the value is not valid for the attribute
      • containsValue

        public final boolean containsValue​(java.lang.String value)
        Is this value included in the enumeration?
        Parameters:
        value - the String value to look up
        Returns:
        true if the value is valid
      • indexOfValue

        public final int indexOfValue​(java.lang.String value)
        get the index of a value in this enumeration.
        Parameters:
        value - the string value to look for.
        Returns:
        the index of the value in the array of strings or -1 if it cannot be found.
        See Also:
        getValues()
      • getValue

        public final java.lang.String getValue()
        Returns:
        the selected value.
      • getIndex

        public final int getIndex()
        Returns:
        the index of the selected value in the array.
        See Also:
        getValues()
      • toString

        public java.lang.String toString()
        Convert the value to its string form.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string form of the value.