docs: @Override
      public char next() {
          ++docPos;
          if (docPos < segmentEnd || segmentEnd >= doc.getLength()) {
              return text.next();
          }
          try {
              doc.getText(segmentEnd, doc.getLength() - segmentEnd, text);
          } catch (BadLocationException e) {
              throw new RuntimeException(e);
          }
          segmentEnd += text.count;
          return text.current();
      }