public String getPageAnnoForGridEvent ( SSpan span ) { int left = getLeftIndexFromSNode ( span ) ; int right = getRightIndexFromSNode ( span ) ; if ( sspans == null ) { log . warn ( "no page annos found" ) ; return null ; } // lookup left index int leftIdx = - 1 ; for ( Integer i : sspans . keySet ( ) ) { if ( i <= left ) { leftIdx = i ; } } if ( leftIdx == - 1 ) { log . debug ( "no left index found" ) ; return null ; } // lookup right key int rightIdx = - 1 ; for ( Integer i : sspans . get ( leftIdx ) . keySet ( ) ) { if ( i >= right ) { rightIdx = i ; } } if ( rightIdx == - 1 ) { log . debug ( "no right index found" ) ; return null ; } return getPageFromAnnotation ( span ) ; }
Returns a page annotation for a span if the span is overlapped by a page annotation .