private byte skipTagBackward(){
  int initialCharIndex=charIndex;
  while (charIndex > 0) {
    lastChar=text.charAt(--charIndex);
    if (lastChar == '<') {
      return Character.DIRECTIONALITY_WHITESPACE;
    }
    if (lastChar == '>') {
      break;
    }
    if (lastChar == '"' || lastChar == '\'') {
      char quote=lastChar;
      while (charIndex > 0 && (lastChar=text.charAt(--charIndex)) != quote) {
      }
    }
  }
  charIndex=initialCharIndex;
  lastChar='>';
  return Character.DIRECTIONALITY_OTHER_NEUTRALS;
}

private byte skipTagBackward ( ) { int initialCharIndex = charIndex ; while ( charIndex > 0 ) { lastChar = text . charAt ( -- charIndex ) ; if ( lastChar == '<' ) { return Character . DIRECTIONALITY_WHITESPACE ; } if ( lastChar == '>' ) { break ; } if ( lastChar == '"' || lastChar == '\'' ) { char quote = lastChar ; while ( charIndex > 0 && ( lastChar = text . charAt ( -- charIndex ) ) != quote ) { } } } charIndex = initialCharIndex ; lastChar = '>' ; return Character . DIRECTIONALITY_OTHER_NEUTRALS ; }
advances charindex backward through an html tag ( after the closing & gt ; has already been read ) and returns character . directionality_whitespace . if there is no matching & lt ; , does not change charindex and returns character . directionality_other_neutrals ( for the & gt ; that hadn ' t been part of a tag after all ) . nevertheless , the running time for calling skiptagbackward ( ) in a loop remains linear in the size of the text , even for a text like " & gt ; & gt ; & gt ; & gt ; " , because skiptagbackward ( ) also stops looking for a matching & lt ; when it encounters another & gt ; .
