question: byte dirTypeBackward ( ) { lastChar = text . charAt ( charIndex - 1 ) ; if ( Character . isLowSurrogate ( lastChar ) ) { int codePoint = Character . codePointBefore ( text , charIndex ) ; charIndex -= Character . charCount ( codePoint ) ; return Character . getDirectionality ( codePoint ) ; } charIndex -- ; byte dirType = getCachedDirectionality ( lastChar ) ; if ( isHtml ) { if ( lastChar == '>' ) { dirType = skipTagBackward ( ) ; } else if ( lastChar == ';' ) { dirType = skipEntityBackward ( ) ; } } return dirType ; }
target:  Returns the Character.DIRECTIONALITY_... value of the preceding codepoint and advances charIndex backwards. If isHtml, and the codepoint is the end of a complete HTML tag or entity, advances over the whole tag/entity and returns Character.DIRECTIONALITY_WHITESPACE. For an entity, it would be best to figure out the actual character, and return its dirtype, but treating it as whitespace is good enough for our purposes.