src/share/classes/java/text/CharacterIterator.java

Print this page

        

*** 60,90 **** * outside this range. * * <P>Examples:<P> * * Traverse the text from start to finish ! * <pre> * public void traverseForward(CharacterIterator iter) { * for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { * processChar(c); * } * } ! * </pre> * * Traverse the text backwards, from end to start ! * <pre> * public void traverseBackward(CharacterIterator iter) { * for(char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) { * processChar(c); * } * } ! * </pre> * * Traverse both forward and backward from a given position in the text. * Calls to notBoundary() in this example represents some * additional stopping criteria. ! * <pre> * public void traverseOut(CharacterIterator iter, int pos) { * for (char c = iter.setIndex(pos); * c != CharacterIterator.DONE && notBoundary(c); * c = iter.next()) { * } --- 60,90 ---- * outside this range. * * <P>Examples:<P> * * Traverse the text from start to finish ! * <pre>{@code * public void traverseForward(CharacterIterator iter) { * for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { * processChar(c); * } * } ! * }</pre> * * Traverse the text backwards, from end to start ! * <pre>{@code * public void traverseBackward(CharacterIterator iter) { * for(char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) { * processChar(c); * } * } ! * }</pre> * * Traverse both forward and backward from a given position in the text. * Calls to notBoundary() in this example represents some * additional stopping criteria. ! * <pre>{@code * public void traverseOut(CharacterIterator iter, int pos) { * for (char c = iter.setIndex(pos); * c != CharacterIterator.DONE && notBoundary(c); * c = iter.next()) { * }
*** 94,104 **** * c = iter.previous()) { * } * int start = iter.getIndex(); * processSection(start, end); * } ! * </pre> * * @see StringCharacterIterator * @see AttributedCharacterIterator */ --- 94,104 ---- * c = iter.previous()) { * } * int start = iter.getIndex(); * processSection(start, end); * } ! * }</pre> * * @see StringCharacterIterator * @see AttributedCharacterIterator */