public String getValueByLocalName ( String localName ) { // NOTE: can't use hashing, must do linear scan switch ( mAttrCount ) { case 4 : if ( mAttributes [ 0 ] . hasLocalName ( localName ) ) return getValue ( 0 ) ; if ( mAttributes [ 1 ] . hasLocalName ( localName ) ) return getValue ( 1 ) ; if ( mAttributes [ 2 ] . hasLocalName ( localName ) ) return getValue ( 2 ) ; if ( mAttributes [ 3 ] . hasLocalName ( localName ) ) return getValue ( 3 ) ; return null ; case 3 : if ( mAttributes [ 0 ] . hasLocalName ( localName ) ) return getValue ( 0 ) ; if ( mAttributes [ 1 ] . hasLocalName ( localName ) ) return getValue ( 1 ) ; if ( mAttributes [ 2 ] . hasLocalName ( localName ) ) return getValue ( 2 ) ; return null ; case 2 : if ( mAttributes [ 0 ] . hasLocalName ( localName ) ) return getValue ( 0 ) ; if ( mAttributes [ 1 ] . hasLocalName ( localName ) ) return getValue ( 1 ) ; return null ; case 1 : if ( mAttributes [ 0 ] . hasLocalName ( localName ) ) return getValue ( 0 ) ; return null ; case 0 : return null ; default : for ( int i = 0 , end = mAttrCount ; i < end ; ++ i ) { if ( mAttributes [ i ] . hasLocalName ( localName ) ) { return getValue ( i ) ; } } return null ; } }
Specialized version in which namespace information is completely ignored .