public final void decodeValue ( int index , TypedValueDecoder tvd ) throws IllegalArgumentException { if ( index < 0 || index >= mAttrCount ) { throwIndex ( index ) ; } /* Should be faster to pass the char array even if we might * have a String */ // Either way, need to trim before passing: char [ ] buf = mValueBuilder . getCharBuffer ( ) ; int start = mAttributes [ index ] . mValueStartOffset ; int end = getValueStartOffset ( index + 1 ) ; while ( true ) { if ( start >= end ) { tvd . handleEmptyValue ( ) ; return ; } if ( ! StringUtil . isSpace ( buf [ start ] ) ) { break ; } ++ start ; } // Trailing space? while ( -- end > start && StringUtil . isSpace ( buf [ end ] ) ) { } tvd . decode ( buf , start , end + 1 ) ; }
Method called to decode the whole attribute value as a single typed value . Decoding is done using the decoder provided .