private void registerPrefixIntersection ( String field , String prefix , int start , int end , HashMap < String , HashSet < Integer > > docFieldAdministration ) { if ( ! intersectingPrefixes . containsKey ( field ) ) { intersectingPrefixes . put ( field , new HashSet < String > ( ) ) ; } else if ( intersectingPrefixes . get ( field ) . contains ( prefix ) ) { return ; } HashSet < Integer > docFieldPrefixAdministration ; if ( ! docFieldAdministration . containsKey ( prefix ) ) { docFieldPrefixAdministration = new HashSet <> ( ) ; docFieldAdministration . put ( prefix , docFieldPrefixAdministration ) ; } else { docFieldPrefixAdministration = docFieldAdministration . get ( prefix ) ; // check for ( int p = start ; p <= end ; p ++ ) { if ( docFieldPrefixAdministration . contains ( p ) ) { intersectingPrefixes . get ( field ) . add ( prefix ) ; docFieldAdministration . remove ( prefix ) ; return ; } } } // update for ( int p = start ; p <= end ; p ++ ) { docFieldPrefixAdministration . add ( p ) ; } }
Register prefix intersection .