* java/text/CollationKey.java: Implement Comparable.
(compareTo(Object)): New method.
* java/text/Collator.java (compare(Object,Object)): New method.
Implement Comparator.
* java/util/zip/InflaterInputStream.java (available): New method.
(close): New method.
(read, available, skip, fill): Throw exception if stream closed.
* java/util/zip/ZipInputStream.java (read, skip, readFully, fill,
getNextEntry): Throw exception if closed.
From-SVN: r37525
+2000-11-17 Tom Tromey <tromey@cygnus.com>
+
+ * java/text/CollationKey.java: Implement Comparable.
+ (compareTo(Object)): New method.
+ * java/text/Collator.java (compare(Object,Object)): New method.
+ Implement Comparator.
+
+ * java/util/zip/InflaterInputStream.java (available): New method.
+ (close): New method.
+ (read, available, skip, fill): Throw exception if stream closed.
+ * java/util/zip/ZipInputStream.java (read, skip, readFully, fill,
+ getNextEntry): Throw exception if closed.
+
+2000-11-16 Tom Tromey <tromey@cygnus.com>
+
+ * java/io/PushbackReader.java: Merged with Classpath.
+ * java/util/Arrays.java: Updated from Classpath.
+
+ * scripts/blocks.pl: New file.
+ * java/lang/Character.java (Subset): New class.
+ (UnicodeBlock): New class.
+
+ * java/lang/Math.java (toDegrees, toRadians): New methods.
+
+ * java/lang/Float.java: Implement Comparable.
+ (compareTo): New methods.
+ * java/lang/Double.java: Implement Comparable.
+ (compareTo): New methods.
+
2000-11-16 Warren Levy <warrenl@cygnus.com>
* java/beans/PropertyChangeSupport.java (propertyListeners): Made
// CollationKey.java - Sort key for locale-sensitive String.
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libgcj.
* Status: Believed complete and correct.
*/
-public final class CollationKey
+public final class CollationKey implements Comparable
{
public int compareTo (CollationKey target)
{
return key.length - target.key.length;
}
+ public int compareTo (Object o)
+ {
+ return compareTo ((CollationKey) o);
+ }
+
public boolean equals (Object obj)
{
if (! (obj instanceof CollationKey))
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.util.Comparator;
/**
* @author Tom Tromey <tromey@cygnus.com>
* Status: Mostly complete, but parts stubbed out. Look for FIXME.
*/
-public abstract class Collator implements Cloneable
+public abstract class Collator implements Comparator, Cloneable
{
public static final int NO_DECOMPOSITION = 0;
public static final int CANONICAL_DECOMPOSITION = 1;
public abstract int compare (String source, String target);
+ public int compare (Object o1, Object o2)
+ {
+ return compare ((String) o1, (String) o2);
+ }
+
public boolean equals (Object obj)
{
if (! (obj instanceof Collator))
// InflaterInputStream.java - Input stream filter for decompressing.
-/* Copyright (C) 1999 Free Software Foundation
+/* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libgcj.
{
protected void fill () throws IOException
{
+ if (inf == null)
+ throw new IOException ("stream closed");
len = in.read(buf, 0, buf.length);
if (len != -1)
inf.setInput(buf, 0, len);
public int read (byte[] buf, int off, int len) throws IOException
{
+ if (inf == null)
+ throw new IOException ("stream closed");
if (inf.finished())
return -1;
if (inf.needsInput())
}
}
+ public void close () throws IOException
+ {
+ inf = null;
+ super.close ();
+ }
+
+ public int available () throws IOException
+ {
+ // According to the JDK 1.2 docs, this should only ever return 0
+ // or 1 and should not be relied upon by Java programs.
+ if (inf == null)
+ throw new IOException ("stream closed");
+ return inf.finished () ? 0 : 1;
+ }
+
public long skip (long n) throws IOException
{
+ if (inf == null)
+ throw new IOException ("stream closed");
+
if (n == 0)
return 0;
public ZipEntry getNextEntry () throws IOException
{
+ if (closed)
+ throw new IOException ("stream closed");
if (current != null)
closeEntry();
if (in.read() != 'P'
// back data.
protected void fill () throws IOException
{
+ if (closed)
+ throw new IOException ("stream closed");
int count = buf.length;
if (count > compressed_bytes)
count = compressed_bytes;
{
return new ZipEntry (name);
}
-
+
public int read (byte[] b, int off, int len) throws IOException
{
+ if (closed)
+ throw new IOException ("stream closed");
if (len > avail)
len = avail;
int count;
public long skip (long n) throws IOException
{
+ if (closed)
+ throw new IOException ("stream closed");
if (n > avail)
n = avail;
long count;
return count;
}
- public int available() {
- if (closed)
- return 0;
- else
- return 1;
+ public int available()
+ {
+ return closed ? 0 : 1;
}
private void readFully (byte[] b) throws IOException