This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.text - some merging
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 15 Oct 2003 16:53:42 +0200
- Subject: FYI: Patch: java.text - some merging
Hi list,
I commited the attache patch to make java.text a little bit more merged with
classpath.
Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2270
diff -u -b -B -r1.2270 ChangeLog
--- ChangeLog 15 Oct 2003 14:02:37 -0000 1.2270
+++ ChangeLog 15 Oct 2003 14:47:25 -0000
@@ -1,5 +1,18 @@
2003-10-15 Michael Koch <konqueror@gmx.de>
+ * java/text/CollationElementIterator.java
+ (CollationElementIterator): Moved, documenatation added, call setText.
+ (next): Reformated.
+ (reset): Reformated.
+ (setText): New method.
+ (getOffset): New method.
+ * java/text/CollationKey.java
+ (getSourceString): Reformated.
+ (hashCode): Reformated.
+ (toByteArray): Reformated.
+
+2003-10-15 Michael Koch <konqueror@gmx.de>
+
* java/util/zip/InflaterInputStream.java
(InflaterInputStream): Renamed infl to inf and bufsize to size,
added description to exception, check for inf == null and size < 0.
Index: java/text/CollationElementIterator.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/text/CollationElementIterator.java,v
retrieving revision 1.7
diff -u -b -B -r1.7 CollationElementIterator.java
--- java/text/CollationElementIterator.java 19 Jun 2003 15:13:31 -0000 1.7
+++ java/text/CollationElementIterator.java 15 Oct 2003 14:47:25 -0000
@@ -82,18 +82,32 @@
int lookahead;
/**
+ * This method initializes a new instance of <code>CollationElementIterator</code>
+ * to iterate over the specified <code>String</code> using the rules in the
+ * specified <code>RuleBasedCollator</code>.
+ *
+ * @param collator The <code>RuleBasedCollation</code> used for calculating collation values
+ * @param text The <code>String</code> to iterate over.
+ */
+ CollationElementIterator (String text, RuleBasedCollator collator)
+ {
+ setText (text);
+ this.collator = collator;
+ }
+
+ /**
* This method returns the collation ordering value of the next character
* in the string. This method will return <code>NULLORDER</code> if the
* end of the string was reached.
*
* @return The collation ordering value.
*/
- public int next ()
+ public int next()
{
if (index == text.length())
return NULLORDER;
- return collator.ceiNext(this);
+ return collator.ceiNext (this);
}
/**
@@ -114,7 +128,7 @@
* This method resets the internal position pointer to read from the
* beginning of the <code>String again.
*/
- public void reset ()
+ public void reset()
{
index = 0;
}
@@ -147,14 +161,33 @@
return (short) (order & 255);
}
- // Non-public constructor.
- CollationElementIterator (String text, RuleBasedCollator collator)
+ /**
+ * This method sets the <code>String</code> that it is iterating over
+ * to the specified <code>String</code>.
+ *
+ * @param text The new <code>String</code> to iterate over.
+ *
+ * @since 1.2
+ */
+ public void setText (String text)
{
this.text = text;
this.index = 0;
this.lookahead_set = false;
this.lookahead = 0;
- this.collator = collator;
+ }
+
+ /**
+ * This method returns the current offset into the <code>String</code>
+ * that is being iterated over.
+ *
+ * @return The iteration index position.
+ *
+ * @since 1.2
+ */
+ public int getOffset()
+ {
+ return index;
}
} // class CollationElementIterator
Index: java/text/CollationKey.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/text/CollationKey.java,v
retrieving revision 1.6
diff -u -b -B -r1.6 CollationKey.java
--- java/text/CollationKey.java 19 May 2003 09:09:23 -0000 1.6
+++ java/text/CollationKey.java 15 Oct 2003 14:47:25 -0000
@@ -169,7 +169,7 @@
*
* @return The source <code>String</code> for this object.
*/
- public String getSourceString ()
+ public String getSourceString()
{
return originalText;
}
@@ -181,7 +181,7 @@
*
* @return A hash value for this object.
*/
- public int hashCode ()
+ public int hashCode()
{
// We just follow BitSet instead of thinking up something new.
long h = originalText.hashCode();
@@ -195,7 +195,7 @@
*
* @param A byte array containing the collation bit sequence.
*/
- public byte[] toByteArray ()
+ public byte[] toByteArray()
{
byte[] r = new byte[4 * key.length];
int off = 0;