public String put(String name,String value)
    {
        if (value==null)
            return remove(name);
        
        FieldInfo info=getFieldInfo(name);
        Field field=getField(info,false);
        // Look for value to replace.
        if (field!=null)
        {
            String old=(field._version==_version)?field._value:null;
            field.reset(value,_version);

            field=field._next;
            while(field!=null)
            {
                field.clear();
                field=field._next;
            }
            return old;    
        }
        else
        {
            // new value;
            field=new Field(info,value,_version);
            int hi=info.hashCode();
            if (hi<_index.length)
                _index[hi]=_fields.size();
            _fields.add(field);
            return null;
        }
    }
public String put ( String name , String value ) { if ( value == null ) return remove ( name ) ; FieldInfo info = getFieldInfo ( name ) ; Field field = getField ( info , false ) ; if ( field != null ) { String old = ( field . _version == _version ) ? field . _value : null ; field . reset ( value , _version ) ; field = field . _next ; while ( field != null ) { field . clear ( ) ; field = field . _next ; } return old ; } else { field = new Field ( info , value , _version ) ; int hi = info . hashCode ( ) ; if ( hi < _index . length ) _index [ hi ] = _fields . size ( ) ; _fields . add ( field ) ; return null ; } }
Set a field.
@param name the name of the field
@param value the value of the field. If null the field is cleared.