CollationKey.java: Implement Comparable.

* 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
This commit is contained in:
Tom Tromey 2000-11-17 20:44:03 +00:00 committed by Tom Tromey
parent 6414587c8b
commit 4cdfd292e3
5 changed files with 78 additions and 10 deletions

View file

@ -13,6 +13,7 @@ package java.text;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Comparator;
/**
* @author Tom Tromey <tromey@cygnus.com>
@ -23,7 +24,7 @@ import java.util.ResourceBundle;
* 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;
@ -42,6 +43,11 @@ public abstract class Collator implements Cloneable
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))