public void setValue ( T value ) throws IllegalArgumentException { Integer b = attributeClass . lookupInt . 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 IdType, " + 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. IdAttribute newAttribute = attributeClass . createIdAttribute ( value ) ; b = newAttribute . value ; } } // Set the new value as the value of this attribute. this . value = b ; }
Sets the specified object 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 .