public void advance() { if (mySegmentIterator.atEnd()) { myRangeIterator.advance(); TextAttributes textAttributes = myRangeIterator.getTextAttributes(); myCurrentFontStyle = textAttributes == null ? Font.PLAIN : textAttributes.getFontType(); myCurrentForegroundColor = textAttributes == null ? null : textAttributes.getForegroundColor(); myCurrentBackgroundColor = textAttributes == null ? null : textAttributes.getBackgroundColor(); mySegmentIterator.reset( myRangeIterator.getRangeStart(), myRangeIterator.getRangeEnd(), myCurrentFontStyle); } mySegmentIterator.advance(); }
public boolean atEnd() { return myRangeIterator.atEnd() && mySegmentIterator.atEnd(); }