@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();
}

@ 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 ( ) ; }
increments the iterator ' s index by one and returns the character at the new index .
