public Map . Entry getEntry ( String key , int offset , int length ) { if ( key == null ) return _nullEntry ; Node node = _root ; int ni = - 1 ; // look for best match charLoop : for ( int i = 0 ; i < length ; i ++ ) { char c = key . charAt ( offset + i ) ; // Advance node if ( ni == - 1 ) { ni = 0 ; node = ( node . _children == null ) ? null : node . _children [ c % _width ] ; } // Look through the node chain while ( node != null ) { // If it is a matching node, goto next char if ( node . _char [ ni ] == c || _ignoreCase && node . _ochar [ ni ] == c ) { ni ++ ; if ( ni == node . _char . length ) ni = - 1 ; continue charLoop ; } // No char match, so if mid node then no match at all. if ( ni > 0 ) return null ; // try next in chain node = node . _next ; } return null ; } if ( ni > 0 ) return null ; if ( node != null && node . _key == null ) return null ; return node ; }
Get a map entry by substring key .