From b98cbaacb885e851d5b7a6399a9b587d53e305f2 Mon Sep 17 00:00:00 2001 From: mkoch Date: Fri, 23 Jan 2004 15:15:31 +0000 Subject: 2004-01-23 Michael Koch * java/text/CollationElementIterator.java: (setText): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76423 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/text/CollationElementIterator.java | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'libjava/java') diff --git a/libjava/java/text/CollationElementIterator.java b/libjava/java/text/CollationElementIterator.java index ecc95231d30..691d943d21b 100644 --- a/libjava/java/text/CollationElementIterator.java +++ b/libjava/java/text/CollationElementIterator.java @@ -1,5 +1,5 @@ /* CollationElementIterator.java -- Walks through collation elements - Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation + Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation This file is part of GNU Classpath. @@ -180,6 +180,27 @@ public final class CollationElementIterator this.lookahead = 0; } + /** + * This method sets the String that it is iterating over + * to the String represented by the specified + * CharacterIterator. + * + * @param source The CharacterIterator containing the new + * String to iterate over. + */ + public void setText(CharacterIterator source) + { + StringBuffer expand = new StringBuffer(); + + // For now assume we read from the beginning of the string. + for (char c = source.first(); + c != CharacterIterator.DONE; + c = source.next()) + expand.append(c); + + setText(expand.toString()); + } + /** * This method returns the current offset into the String * that is being iterated over. -- cgit v1.2.3