From: Michael Koch Date: Fri, 23 Jan 2004 15:15:31 +0000 (+0000) Subject: 2004-01-23 Michael Koch X-Git-Tag: releases/gcc-4.0.0~10800 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0bf056e74c52135e14eb3ae11a599c2ab7ecb4a;p=thirdparty%2Fgcc.git 2004-01-23 Michael Koch * java/text/CollationElementIterator.java: (setText): New method. From-SVN: r76423 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 578a308d8dab..ffec8ce8e050 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-01-23 Michael Koch + + * java/text/CollationElementIterator.java: + (setText): New method. + 2004-01-23 Michael Koch * gnu/java/nio/FileLockImpl.java: diff --git a/libjava/java/text/CollationElementIterator.java b/libjava/java/text/CollationElementIterator.java index ecc95231d309..691d943d21b5 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.