jfreechart-master/src/main/java/org/jfree/chart/legend/LegendItem.java
/**
     * Returns a string containing the characters from the given iterator.
     *
     * @param iterator  the iterator ({@code null} not permitted).
     *
     * @return A string.
     */
Returns a string containing the characters from the given iterator.
@param iterator  the iterator ( null not permitted).

@return A string.
Returns a string containing the characters from the given iterator . @param iterator the iterator ( null not permitted ) . @return A string .
private String characterIteratorToString(CharacterIterator iterator) {
        int endIndex = iterator.getEndIndex();
        int beginIndex = iterator.getBeginIndex();
        int count = endIndex - beginIndex;
        if (count <= 0) {
            return "";
        }
        char[] chars = new char[count];
        int i = 0;
        char c = iterator.first();
        while (c != CharacterIterator.DONE) {
            chars[i] = c;
            i++;
            c = iterator.next();
        }
        return new String(chars);
    }
private String characterIteratorToString ( CharacterIterator iterator ) { int endIndex = iterator . getEndIndex ( ) ; int beginIndex = iterator . getBeginIndex ( ) ; int count = endIndex - beginIndex ; if ( count <= 0 ) { return "" ; } char [ ] chars = new char [ count ] ; int i = 0 ; char c = iterator . first ( ) ; while ( c != CharacterIterator . DONE ) { chars [ i ] = c ; i ++ ; c = iterator . next ( ) ; } return new String ( chars ) ; }
Returns a string containing the characters from the given iterator.
Returns a string containing the characters from the given iterator .