question: byte dirTypeForward ( ) { lastChar = text . charAt ( charIndex ) ; if ( Character . isHighSurrogate ( lastChar ) ) { int codePoint = Character . codePointAt ( text , charIndex ) ; charIndex += Character . charCount ( codePoint ) ; return Character . getDirectionality ( codePoint ) ; } charIndex ++ ; byte dirType = getCachedDirectionality ( lastChar ) ; if ( isHtml ) { if ( lastChar == '<' ) { dirType = skipTagForward ( ) ; } else if ( lastChar == '&' ) { dirType = skipEntityForward ( ) ; } } return dirType ; }
target:  Returns the Character.DIRECTIONALITY_... value of the next codepoint and advances charIndex. If isHtml, and the codepoint is '<' or '&', advances through the 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.