lojix/power_model/src/main/com/thesett/aima/attribute/impl/EnumeratedStringAttribute.java
public void setStringValue(String value) throws IllegalArgumentException
    {
        Byte b = attributeClass.lookupByte.get(value);

        // Check if the value is not already a memeber of the attribute class.
        if (b == null)
        {
            // Check if the attribute class has been finalized yet.
            if (attributeClass.finalized)
            {
                throw new IllegalArgumentException("The value to set, " + value +
                    ", is not already a member of the finalized EnumeratedStringType, " +
                    attributeClass.attributeClassName + ".");
            }
            else
            {
                // Add the new value to the attribute class. Delegate to the factory to do this so that strings are
                // interned and so on.
                EnumeratedStringAttribute newAttribute = attributeClass.createStringAttribute(value);
                b = newAttribute.value;
            }
        }

        // Set the new value as the value of this attribute.
        this.value = b;
    }
public void setStringValue(String value) throws IllegalArgumentException
    {
        Byte b = attributeClass.lookupByte.get(value);

        // Check if the value is not already a memeber of the attribute class.
        if (b == null)
        {
            // Check if the attribute class has been finalized yet.
            if (attributeClass.finalized)
            {
                throw new IllegalArgumentException("The value to set, " + value +
                    ", is not already a member of the finalized EnumeratedStringType, " +
                    attributeClass.attributeClassName + ".");
            }
            else
            {
                // Add the new value to the attribute class. Delegate to the factory to do this so that strings are
                // interned and so on.
                EnumeratedStringAttribute newAttribute = attributeClass.createStringAttribute(value);
                b = newAttribute.value;
            }
        }

        // Set the new value as the value of this attribute.
        this.value = b;
    }
public void setStringValue ( String value ) throws IllegalArgumentException { Byte b = attributeClass . lookupByte . get ( value ) ; // Check if the value is not already a memeber of the attribute class. if ( b == null ) { // Check if the attribute class has been finalized yet. if ( attributeClass . finalized ) { throw new IllegalArgumentException ( "The value to set, " + value + ", is not already a member of the finalized EnumeratedStringType, " + attributeClass . attributeClassName + "." ) ; } else { // Add the new value to the attribute class. Delegate to the factory to do this so that strings are // interned and so on. EnumeratedStringAttribute newAttribute = attributeClass . createStringAttribute ( value ) ; b = newAttribute . value ; } } // Set the new value as the value of this attribute. this . value = b ; }
Sets the specified string as the value of this attribute. The value to set must be a legitimate member of this
attributes type, when the type has been finalized. If the type has yet to be finalized then the new value is
added to the set of possible values for the type.

@param  value The new value to set.

@throws IllegalArgumentException If the type has been finalized and the new value is not a member of the type.
Sets the specified string as the value of this attribute . The value to set must be a legitimate member of this attributes type when the type has been finalized . If the type has yet to be finalized then the new value is added to the set of possible values for the type .