private int getDimension ( PathSignature path ) { Integer index = pathToIndex . get ( path ) ; if ( index == null && ! readOnly ) { synchronized ( this ) { // recheck to see if the term was added while blocking index = pathToIndex . get ( path ) ; // if another thread has not already added this word while the // current thread was blocking waiting on the lock, then add it. if ( index == null ) { int i = pathToIndex . size ( ) ; pathToIndex . put ( path , i ) ; return i ; // avoid the auto-boxing to assign i to index } } } return index ; }
Returns the dimension represention the occurrence of the provided path . If the path was not previously assigned an index this method adds one for it and returns that index .