summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-16 05:47:01 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-16 05:47:01 +0000
commitb8ae419b4b9c44c0788e726e6261a1ee6798de21 (patch)
treeae47326b1fbf6a430f495ac6b9f0b6405f37d7d6
parentc4cf0b6b70f7ab3d22875ea52d83ad25fd4d9da9 (diff)
downloadgcc-b8ae419b4b9c44c0788e726e6261a1ee6798de21.tar.gz
2001-10-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/util/HashMap.java (HashEntry.clone): Removed. (HashMap(Map)): Use putAllInternal. (clone): Likewise. (putAllInternal): New method. Efficient counterpart to putAll which does not call put(). * java/util/LinkedHashMap.java (rethread): Removed. (putAllInternal): New method. Clear "head" and "tail". (addEntry): New argument "callRemove". Don't call removeEldestEntry() if callRemove == false. * Makefile.am: Add new classes RandomAccess and LinkedHashMap. * Makefile.in: Rebuilt. 2001-10-15 Eric Blake <ebb9@email.byu.edu> * java/util/Collection.java: Updated javadoc. * java/util/Comparator.java: Updated javadoc. * java/util/Enumeration.java: Updated javadoc. * java/util/Iterator.java: Updated javadoc. * java/util/List.java: Updated javadoc. * java/util/ListIterator.java: Updated javadoc. * java/util/Map.java: Updated javadoc. * java/util/RandomAccess.java: New file. * java/util/Set.java: Updated javadoc. * java/util/SortedMap.java: Updated javadoc. * java/util/SortedSet.java: Updated javadoc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46277 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog30
-rw-r--r--libjava/Makefile.am2
-rw-r--r--libjava/Makefile.in1225
-rw-r--r--libjava/java/util/Collection.java75
-rw-r--r--libjava/java/util/Comparator.java71
-rw-r--r--libjava/java/util/Enumeration.java15
-rw-r--r--libjava/java/util/HashMap.java812
-rw-r--r--libjava/java/util/Iterator.java46
-rw-r--r--libjava/java/util/LinkedHashMap.java474
-rw-r--r--libjava/java/util/List.java345
-rw-r--r--libjava/java/util/ListIterator.java118
-rw-r--r--libjava/java/util/Map.java270
-rw-r--r--libjava/java/util/RandomAccess.java53
-rw-r--r--libjava/java/util/Set.java191
-rw-r--r--libjava/java/util/SortedMap.java126
-rw-r--r--libjava/java/util/SortedSet.java130
16 files changed, 2222 insertions, 1761 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c2213ec543f..860b81d88e3 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,32 @@
+2001-10-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/util/HashMap.java (HashEntry.clone): Removed.
+ (HashMap(Map)): Use putAllInternal.
+ (clone): Likewise.
+ (putAllInternal): New method. Efficient counterpart to putAll which
+ does not call put().
+ * java/util/LinkedHashMap.java (rethread): Removed.
+ (putAllInternal): New method. Clear "head" and "tail".
+ (addEntry): New argument "callRemove". Don't call removeEldestEntry()
+ if callRemove == false.
+
+ * Makefile.am: Add new classes RandomAccess and LinkedHashMap.
+ * Makefile.in: Rebuilt.
+
+2001-10-15 Eric Blake <ebb9@email.byu.edu>
+
+ * java/util/Collection.java: Updated javadoc.
+ * java/util/Comparator.java: Updated javadoc.
+ * java/util/Enumeration.java: Updated javadoc.
+ * java/util/Iterator.java: Updated javadoc.
+ * java/util/List.java: Updated javadoc.
+ * java/util/ListIterator.java: Updated javadoc.
+ * java/util/Map.java: Updated javadoc.
+ * java/util/RandomAccess.java: New file.
+ * java/util/Set.java: Updated javadoc.
+ * java/util/SortedMap.java: Updated javadoc.
+ * java/util/SortedSet.java: Updated javadoc.
+
2001-10-15 Tom Tromey <tromey@redhat.com>
* java/lang/reflect/AccessibleObject.java (checkPermission):
@@ -190,6 +219,7 @@
2001-10-03 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* resolve.cc (_Jv_PrepareClass): Fix typos in vtable layout.
+ * gij.cc (version): Use GCJVERSION.
2001-10-02 Mark Wielaard <mark@klomp.org>
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index ddb1588efd5..fd450870c02 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -1089,6 +1089,7 @@ java/util/Hashtable.java \
java/util/IdentityHashMap.java \
java/util/Iterator.java \
java/util/LinkedList.java \
+java/util/LinkedHashMap.java \
java/util/List.java \
java/util/ListIterator.java \
java/util/ListResourceBundle.java \
@@ -1102,6 +1103,7 @@ java/util/Properties.java \
java/util/PropertyPermission.java \
java/util/PropertyResourceBundle.java \
java/util/Random.java \
+java/util/RandomAccess.java \
java/util/ResourceBundle.java \
java/util/Set.java \
java/util/SimpleTimeZone.java \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index b6d3ed93520..664019e9906 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p1 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -123,38 +123,26 @@ libgcj_basedir = @libgcj_basedir@
mkinstalldirs = @mkinstalldirs@
AUTOMAKE_OPTIONS = foreign
-@TESTSUBDIR_TRUE@SUBDIRS = \
-@TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
-@TESTSUBDIR_FALSE@SUBDIRS = \
-@TESTSUBDIR_FALSE@$(DIRLTDL) gcj include
-@USE_LIBDIR_TRUE@toolexeclibdir = \
-@USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexeclibdir = \
-@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexecdir = \
-@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
-@XLIB_AWT_TRUE@cond_x_ltlibrary = \
-@XLIB_AWT_TRUE@libgcjx.la
-@XLIB_AWT_FALSE@cond_x_ltlibrary = \
+@TESTSUBDIR_TRUE@SUBDIRS = $(DIRLTDL) testsuite gcj include
+@TESTSUBDIR_FALSE@SUBDIRS = $(DIRLTDL) gcj include
+@USE_LIBDIR_TRUE@toolexeclibdir = $(libdir)$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexecdir = $(exec_prefix)/$(target_alias)
+@XLIB_AWT_TRUE@cond_x_ltlibrary = libgcjx.la
+@XLIB_AWT_FALSE@cond_x_ltlibrary =
toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
toolexeclib_DATA = libgcj.spec
data_DATA = libgcj.jar
-@NATIVE_TRUE@bin_PROGRAMS = \
-@NATIVE_TRUE@jv-convert gij rmic rmiregistry
+@NATIVE_TRUE@bin_PROGRAMS = jv-convert gij rmic rmiregistry
bin_SCRIPTS = addr2name.awk
-@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = \
-@CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
-@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = \
-@CANADIAN_TRUE@@NULL_TARGET_FALSE@jar
-@CANADIAN_FALSE@ZIP = \
-@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
-@CANADIAN_TRUE@GCJH = \
-@CANADIAN_TRUE@gcjh
-@CANADIAN_FALSE@GCJH = \
-@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
+@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
+@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = jar
+@CANADIAN_FALSE@ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
+@CANADIAN_TRUE@GCJH = gcjh
+@CANADIAN_FALSE@GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
@@ -169,53 +157,38 @@ JAVAC = $(GCJ_WITH_FLAGS) -C
GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
-AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
- -fdollars-in-identifiers \
- @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
- -DPREFIX="\"$(prefix)\""
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE -DPREFIX="\"$(prefix)\""
-@USING_GCC_TRUE@AM_CFLAGS = \
-@USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
-@USING_GCC_FALSE@AM_CFLAGS = \
-@USING_GCC_FALSE@@LIBGCJ_CFLAGS@
+@USING_GCC_TRUE@AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
+@USING_GCC_FALSE@AM_CFLAGS = @LIBGCJ_CFLAGS@
JCFLAGS = -g
JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
LIBFFIINCS = @LIBFFIINCS@
-INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
- $(GCINCS) $(THREADINCS) $(INCLTDL) \
- $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
+INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include $(GCINCS) $(THREADINCS) $(INCLTDL) $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
nat_files = $(nat_source_files:.cc=.lo)
x_nat_files = $(x_nat_source_files:.cc=.lo)
c_files = $(c_source_files:.c=.lo)
-javao_files = $(java_source_files:.java=.lo) \
- $(built_java_source_files:.java=.lo)
+javao_files = $(java_source_files:.java=.lo) $(built_java_source_files:.java=.lo)
x_javao_files = $(x_java_source_files:.java=.lo)
-libgcj_la_SOURCES = prims.cc posix.cc jni.cc exception.cc \
- resolve.cc defineclass.cc interpret.cc name-finder.cc \
- $(nat_source_files)
+libgcj_la_SOURCES = prims.cc posix.cc jni.cc exception.cc resolve.cc defineclass.cc interpret.cc name-finder.cc $(nat_source_files)
-EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \
- $(c_source_files) $(java_source_files) $(built_java_source_files)
+EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc $(c_source_files) $(java_source_files) $(built_java_source_files)
-libgcj_la_DEPENDENCIES = libgcj.jar $(javao_files) \
- $(c_files) $(GCOBJS) $(THREADOBJS) $(LIBLTDL)
+libgcj_la_DEPENDENCIES = libgcj.jar $(javao_files) $(c_files) $(GCOBJS) $(THREADOBJS) $(LIBLTDL)
-libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) \
- $(THREADOBJS)
+libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) $(THREADOBJS)
# Include THREADLIBS here to ensure that the correct version of
# certain linuxthread functions get linked:
-libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLIBS) $(LIBLTDL) \
- $(GCLIBS) $(ZLIBS) \
- -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLIBS) $(LIBLTDL) $(GCLIBS) $(ZLIBS) -version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LINK = $(LIBLINK)
@@ -223,9 +196,7 @@ libgcjx_la_SOURCES = $(x_nat_source_files)
EXTRA_libgcjx_la_SOURCES = $(x_java_source_files)
libgcjx_la_DEPENDENCIES = libgcj.jar $(x_javao_files)
libgcjx_la_LIBADD = $(x_javao_files)
-libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
- -rpath $(toolexeclibdir) \
- -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ -rpath $(toolexeclibdir) -version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcjx_la_LINK = $(LIBLINK)
@@ -234,10 +205,7 @@ CLEANFILES = tmp-list libgcj.jar
SUFFIXES = .class .java .h
-nat_headers = $(ordinary_java_source_files:.java=.h) \
- $(built_java_source_files:.java=.h) \
- java/io/ObjectOutputStream$$PutField.h \
- java/io/ObjectInputStream$$GetField.h
+nat_headers = $(ordinary_java_source_files:.java=.h) $(built_java_source_files:.java=.h) java/io/ObjectOutputStream$$PutField.h java/io/ObjectInputStream$$GetField.h
x_nat_headers = $(x_java_source_files:.java=.h)
@@ -246,22 +214,18 @@ extra_headers = java/lang/Object.h java/lang/Class.h
NM = nm
-@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = \
-@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@gen-from-JIS
+@NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = gen-from-JIS
CONVERT_DIR = gnu/gcj/convert
jv_convert_SOURCES =
EXTRA_jv_convert_SOURCES = $(convert_source_files)
-jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
- -rpath $(toolexeclibdir) -shared-libgcc
+jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert -rpath $(toolexeclibdir) -shared-libgcc
jv_convert_LINK = $(GCJLINK)
-jv_convert_LDADD = $(convert_source_files:.java=.lo) libgcj.la \
- $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+jv_convert_LDADD = $(convert_source_files:.java=.lo) libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
-jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) \
- $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
gij_SOURCES = gij.cc
@@ -272,8 +236,7 @@ gij_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
rmic_SOURCES =
EXTRA_rmic_SOURCES = $(rmi_java_source_files)
-rmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC \
- -rpath $(toolexeclibdir) -shared-libgcc
+rmic_LDFLAGS = --main=gnu.java.rmi.rmic.RMIC -rpath $(toolexeclibdir) -shared-libgcc
rmic_LINK = $(GCJLINK)
rmic_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
@@ -281,1096 +244,59 @@ rmic_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
rmiregistry_SOURCES =
EXTRA_rmiregistry_SOURCES = $(rmi_java_source_files)
-rmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl \
- -rpath $(toolexeclibdir) -shared-libgcc
+rmiregistry_LDFLAGS = --main=gnu.java.rmi.registry.RegistryImpl -rpath $(toolexeclibdir) -shared-libgcc
rmiregistry_LINK = $(GCJLINK)
rmiregistry_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
rmiregistry_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
gen_from_JIS_SOURCES =
-EXTRA_gen_from_JIS_SOURCES = $(srcdir)/$(CONVERT_DIR)/gen-from-JIS.c \
- $(srcdir)/$(CONVERT_DIR)/make-trie.c \
- $(srcdir)/$(CONVERT_DIR)/JIS0201.h \
- $(srcdir)/$(CONVERT_DIR)/JIS0208.h \
- $(srcdir)/$(CONVERT_DIR)/JIS0212.h
+EXTRA_gen_from_JIS_SOURCES = $(srcdir)/$(CONVERT_DIR)/gen-from-JIS.c $(srcdir)/$(CONVERT_DIR)/make-trie.c $(srcdir)/$(CONVERT_DIR)/JIS0201.h $(srcdir)/$(CONVERT_DIR)/JIS0208.h $(srcdir)/$(CONVERT_DIR)/JIS0212.h
gen_from_JIS_LDADD = $(CONVERT_DIR)/gen-from-JIS.o $(CONVERT_DIR)/make-trie.o
-gen_from_JIS_DEPENDENCIES = $(CONVERT_DIR)/gen-from-JIS.o \
- $(CONVERT_DIR)/make-trie.o
-
-
-convert_source_files = \
-gnu/gcj/convert/BytesToUnicode.java \
-gnu/gcj/convert/Convert.java \
-gnu/gcj/convert/Input_8859_1.java \
-gnu/gcj/convert/Input_ASCII.java \
-gnu/gcj/convert/Input_EUCJIS.java \
-gnu/gcj/convert/Input_JavaSrc.java \
-gnu/gcj/convert/Input_SJIS.java \
-gnu/gcj/convert/Input_UTF8.java \
-gnu/gcj/convert/Input_iconv.java \
-gnu/gcj/convert/IOConverter.java \
-gnu/gcj/convert/Output_8859_1.java \
-gnu/gcj/convert/Output_ASCII.java \
-gnu/gcj/convert/Output_EUCJIS.java \
-gnu/gcj/convert/Output_JavaSrc.java \
-gnu/gcj/convert/Output_SJIS.java \
-gnu/gcj/convert/Output_UTF8.java \
-gnu/gcj/convert/Output_iconv.java \
-gnu/gcj/convert/UnicodeToBytes.java
+gen_from_JIS_DEPENDENCIES = $(CONVERT_DIR)/gen-from-JIS.o $(CONVERT_DIR)/make-trie.o
+
+
+convert_source_files = gnu/gcj/convert/BytesToUnicode.java gnu/gcj/convert/Convert.java gnu/gcj/convert/Input_8859_1.java gnu/gcj/convert/Input_ASCII.java gnu/gcj/convert/Input_EUCJIS.java gnu/gcj/convert/Input_JavaSrc.java gnu/gcj/convert/Input_SJIS.java gnu/gcj/convert/Input_UTF8.java gnu/gcj/convert/Input_iconv.java gnu/gcj/convert/IOConverter.java gnu/gcj/convert/Output_8859_1.java gnu/gcj/convert/Output_ASCII.java gnu/gcj/convert/Output_EUCJIS.java gnu/gcj/convert/Output_JavaSrc.java gnu/gcj/convert/Output_SJIS.java gnu/gcj/convert/Output_UTF8.java gnu/gcj/convert/Output_iconv.java gnu/gcj/convert/UnicodeToBytes.java
special_java_source_files = java/lang/Class.java java/lang/Object.java
-awt_java_source_files = \
-gnu/awt/LightweightRedirector.java \
-gnu/awt/j2d/AbstractGraphicsState.java \
-gnu/awt/j2d/DirectRasterGraphics.java \
-gnu/awt/j2d/Graphics2DImpl.java \
-gnu/awt/j2d/IntegerGraphicsState.java \
-gnu/awt/j2d/MappedRaster.java \
-gnu/gcj/awt/BitMaskExtent.java \
-gnu/gcj/awt/Buffers.java \
-gnu/gcj/awt/ComponentDataBlitOp.java \
-gnu/gcj/awt/GLightweightPeer.java \
-gnu/java/beans/editors/ColorEditor.java \
-gnu/java/beans/editors/FontEditor.java \
-gnu/java/beans/editors/NativeBooleanEditor.java \
-gnu/java/beans/editors/NativeByteEditor.java \
-gnu/java/beans/editors/NativeDoubleEditor.java \
-gnu/java/beans/editors/NativeFloatEditor.java \
-gnu/java/beans/editors/NativeIntEditor.java \
-gnu/java/beans/editors/NativeLongEditor.java \
-gnu/java/beans/editors/NativeShortEditor.java \
-gnu/java/beans/editors/StringEditor.java \
-gnu/java/beans/info/ComponentBeanInfo.java \
-gnu/java/beans/BeanInfoEmbryo.java \
-gnu/java/beans/EmptyBeanInfo.java \
-gnu/java/beans/ExplicitBeanInfo.java \
-gnu/java/beans/IntrospectionIncubator.java \
-java/applet/Applet.java \
-java/applet/AppletStub.java \
-java/applet/AppletContext.java \
-java/applet/AudioClip.java \
-java/awt/AWTError.java \
-java/awt/AWTEvent.java \
-java/awt/AWTEventMulticaster.java \
-java/awt/AWTException.java \
-java/awt/AWTPermission.java \
-java/awt/ActiveEvent.java \
-java/awt/Adjustable.java \
-java/awt/BorderLayout.java \
-java/awt/Button.java \
-java/awt/Canvas.java \
-java/awt/CardLayout.java \
-java/awt/Checkbox.java \
-java/awt/CheckboxGroup.java \
-java/awt/CheckboxMenuItem.java \
-java/awt/Choice.java \
-java/awt/Color.java \
-java/awt/Component.java \
-java/awt/ComponentOrientation.java \
-java/awt/Container.java \
-java/awt/Cursor.java \
-java/awt/Dialog.java \
-java/awt/Dimension.java \
-java/awt/Event.java \
-java/awt/EventDispatchThread.java \
-java/awt/EventQueue.java \
-java/awt/FileDialog.java \
-java/awt/FlowLayout.java \
-java/awt/Font.java \
-java/awt/FontMetrics.java \
-java/awt/Frame.java \
-java/awt/Graphics.java \
-java/awt/Graphics2D.java \
-java/awt/GraphicsConfiguration.java \
-java/awt/GridBagConstraints.java \
-java/awt/GridLayout.java \
-java/awt/IllegalComponentStateException.java \
-java/awt/Image.java \
-java/awt/Insets.java \
-java/awt/ItemSelectable.java \
-java/awt/Label.java \
-java/awt/LayoutManager.java \
-java/awt/LayoutManager2.java \
-java/awt/List.java \
-java/awt/Menu.java \
-java/awt/MenuBar.java \
-java/awt/MenuComponent.java \
-java/awt/MenuContainer.java \
-java/awt/MenuItem.java \
-java/awt/MenuShortcut.java \
-java/awt/Paint.java \
-java/awt/PaintContext.java \
-java/awt/Panel.java \
-java/awt/Point.java \
-java/awt/Polygon.java \
-java/awt/PopupMenu.java \
-java/awt/Rectangle.java \
-java/awt/RenderingHints.java \
-java/awt/ScrollPane.java \
-java/awt/Scrollbar.java \
-java/awt/Shape.java \
-java/awt/SystemColor.java \
-java/awt/TextArea.java \
-java/awt/TextComponent.java \
-java/awt/TextField.java \
-java/awt/Toolkit.java \
-java/awt/Transparency.java \
-java/awt/Window.java \
-java/awt/color/ColorSpace.java \
-java/awt/color/ICC_ColorSpace.java \
-java/awt/color/ICC_Profile.java \
-java/awt/datatransfer/Clipboard.java \
-java/awt/event/AWTEventListener.java \
-java/awt/event/ActionEvent.java \
-java/awt/event/ActionListener.java \
-java/awt/event/AdjustmentEvent.java \
-java/awt/event/AdjustmentListener.java \
-java/awt/event/ComponentAdapter.java \
-java/awt/event/ComponentEvent.java \
-java/awt/event/ComponentListener.java \
-java/awt/event/ContainerAdapter.java \
-java/awt/event/ContainerEvent.java \
-java/awt/event/ContainerListener.java \
-java/awt/event/FocusAdapter.java \
-java/awt/event/FocusEvent.java \
-java/awt/event/FocusListener.java \
-java/awt/event/HierarchyBoundsAdapter.java \
-java/awt/event/HierarchyBoundsListener.java \
-java/awt/event/HierarchyEvent.java \
-java/awt/event/HierarchyListener.java \
-java/awt/event/InputEvent.java \
-java/awt/event/InputMethodEvent.java \
-java/awt/event/InputMethodListener.java \
-java/awt/event/InvocationEvent.java \
-java/awt/event/ItemEvent.java \
-java/awt/event/ItemListener.java \
-java/awt/event/KeyAdapter.java \
-java/awt/event/KeyEvent.java \
-java/awt/event/KeyListener.java \
-java/awt/event/MouseAdapter.java \
-java/awt/event/MouseEvent.java \
-java/awt/event/MouseListener.java \
-java/awt/event/MouseMotionAdapter.java \
-java/awt/event/MouseMotionListener.java \
-java/awt/event/PaintEvent.java \
-java/awt/event/TextEvent.java \
-java/awt/event/TextListener.java \
-java/awt/event/WindowAdapter.java \
-java/awt/event/WindowEvent.java \
-java/awt/event/WindowListener.java \
-java/awt/geom/AffineTransform.java \
-java/awt/geom/Dimension2D.java \
-java/awt/geom/Ellipse2D.java \
-java/awt/geom/IllegalPathStateException.java \
-java/awt/geom/Line2D.java \
-java/awt/geom/NoninvertibleTransformException.java \
-java/awt/geom/PathIterator.java \
-java/awt/geom/Point2D.java \
-java/awt/geom/Rectangle2D.java \
-java/awt/geom/RectangularShape.java \
-java/awt/geom/RoundRectangle2D.java \
-java/awt/image/BufferedImage.java \
-java/awt/image/ColorModel.java \
-java/awt/image/ComponentColorModel.java \
-java/awt/image/ComponentSampleModel.java \
-java/awt/image/DataBuffer.java \
-java/awt/image/DataBufferByte.java \
-java/awt/image/DataBufferInt.java \
-java/awt/image/DataBufferUShort.java \
-java/awt/image/DirectColorModel.java \
-java/awt/image/ImageConsumer.java \
-java/awt/image/ImageObserver.java \
-java/awt/image/ImageProducer.java \
-java/awt/image/IndexColorModel.java \
-java/awt/image/PackedColorModel.java \
-java/awt/image/Raster.java \
-java/awt/image/RasterOp.java \
-java/awt/image/SampleModel.java \
-java/awt/image/SinglePixelPackedSampleModel.java \
-java/awt/image/WritableRaster.java \
-java/awt/peer/ButtonPeer.java \
-java/awt/peer/CanvasPeer.java \
-java/awt/peer/CheckboxMenuItemPeer.java \
-java/awt/peer/CheckboxPeer.java \
-java/awt/peer/ChoicePeer.java \
-java/awt/peer/ComponentPeer.java \
-java/awt/peer/ContainerPeer.java \
-java/awt/peer/DialogPeer.java \
-java/awt/peer/FileDialogPeer.java \
-java/awt/peer/FontPeer.java \
-java/awt/peer/FramePeer.java \
-java/awt/peer/LabelPeer.java \
-java/awt/peer/LightweightPeer.java \
-java/awt/peer/ListPeer.java \
-java/awt/peer/MenuBarPeer.java \
-java/awt/peer/MenuComponentPeer.java \
-java/awt/peer/MenuItemPeer.java \
-java/awt/peer/MenuPeer.java \
-java/awt/peer/PanelPeer.java \
-java/awt/peer/PopupMenuPeer.java \
-java/awt/peer/ScrollPanePeer.java \
-java/awt/peer/ScrollbarPeer.java \
-java/awt/peer/TextAreaPeer.java \
-java/awt/peer/TextComponentPeer.java \
-java/awt/peer/TextFieldPeer.java \
-java/awt/peer/WindowPeer.java \
-java/beans/beancontext/BeanContext.java \
-java/beans/beancontext/BeanContextChild.java \
-java/beans/beancontext/BeanContextChildComponentProxy.java \
-java/beans/beancontext/BeanContextChildSupport.java \
-java/beans/beancontext/BeanContextContainerProxy.java \
-java/beans/beancontext/BeanContextEvent.java \
-java/beans/beancontext/BeanContextMembershipEvent.java \
-java/beans/beancontext/BeanContextMembershipListener.java \
-java/beans/beancontext/BeanContextProxy.java \
-java/beans/beancontext/BeanContextServiceAvailableEvent.java \
-java/beans/beancontext/BeanContextServiceProvider.java \
-java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \
-java/beans/beancontext/BeanContextServiceRevokedEvent.java \
-java/beans/beancontext/BeanContextServiceRevokedListener.java \
-java/beans/beancontext/BeanContextServices.java \
-java/beans/beancontext/BeanContextServicesListener.java \
-java/beans/AppletInitializer.java \
-java/beans/BeanDescriptor.java \
-java/beans/BeanInfo.java \
-java/beans/Beans.java \
-java/beans/Customizer.java \
-java/beans/DesignMode.java \
-java/beans/EventSetDescriptor.java \
-java/beans/FeatureDescriptor.java \
-java/beans/IndexedPropertyDescriptor.java \
-java/beans/IntrospectionException.java \
-java/beans/Introspector.java \
-java/beans/MethodDescriptor.java \
-java/beans/ParameterDescriptor.java \
-java/beans/PropertyChangeEvent.java \
-java/beans/PropertyChangeListener.java \
-java/beans/PropertyChangeSupport.java \
-java/beans/PropertyDescriptor.java \
-java/beans/PropertyEditor.java \
-java/beans/PropertyEditorManager.java \
-java/beans/PropertyEditorSupport.java \
-java/beans/PropertyVetoException.java \
-java/beans/SimpleBeanInfo.java \
-java/beans/VetoableChangeListener.java \
-java/beans/VetoableChangeSupport.java \
-java/beans/Visibility.java
-
-
-rmi_java_source_files = \
-java/rmi/activation/Activatable.java \
-java/rmi/activation/ActivateFailedException.java \
-java/rmi/activation/ActivationDesc.java \
-java/rmi/activation/ActivationException.java \
-java/rmi/activation/ActivationGroup.java \
-java/rmi/activation/ActivationGroupDesc.java \
-java/rmi/activation/ActivationGroupID.java \
-java/rmi/activation/ActivationID.java \
-java/rmi/activation/ActivationInstantiator.java \
-java/rmi/activation/ActivationMonitor.java \
-java/rmi/activation/ActivationSystem.java \
-java/rmi/activation/Activator.java \
-java/rmi/activation/UnknownGroupException.java \
-java/rmi/activation/UnknownObjectException.java \
-java/rmi/AccessException.java \
-java/rmi/AlreadyBoundException.java \
-java/rmi/ConnectException.java \
-java/rmi/ConnectIOException.java \
-java/rmi/MarshalException.java \
-java/rmi/MarshalledObject.java \
-java/rmi/Naming.java \
-java/rmi/NoSuchObjectException.java \
-java/rmi/NotBoundException.java \
-java/rmi/RMISecurityException.java \
-java/rmi/RMISecurityManager.java \
-java/rmi/Remote.java \
-java/rmi/RemoteException.java \
-java/rmi/ServerError.java \
-java/rmi/ServerException.java \
-java/rmi/ServerRuntimeException.java \
-java/rmi/StubNotFoundException.java \
-java/rmi/UnexpectedException.java \
-java/rmi/UnknownHostException.java \
-java/rmi/UnmarshalException.java \
-java/rmi/dgc/DGC.java \
-java/rmi/dgc/Lease.java \
-java/rmi/dgc/VMID.java \
-java/rmi/registry/LocateRegistry.java \
-java/rmi/registry/Registry.java \
-java/rmi/registry/RegistryHandler.java \
-java/rmi/server/ExportException.java \
-java/rmi/server/LoaderHandler.java \
-java/rmi/server/LogStream.java \
-java/rmi/server/ObjID.java \
-java/rmi/server/Operation.java \
-java/rmi/server/RMIClassLoader.java \
-java/rmi/server/RMIClientSocketFactory.java \
-java/rmi/server/RMIFailureHandler.java \
-java/rmi/server/RMIServerSocketFactory.java \
-java/rmi/server/RMISocketFactory.java \
-java/rmi/server/RemoteCall.java \
-java/rmi/server/RemoteObject.java \
-java/rmi/server/RemoteRef.java \
-java/rmi/server/RemoteServer.java \
-java/rmi/server/RemoteStub.java \
-java/rmi/server/ServerCloneException.java \
-java/rmi/server/ServerNotActiveException.java \
-java/rmi/server/ServerRef.java \
-java/rmi/server/Skeleton.java \
-java/rmi/server/SkeletonMismatchException.java \
-java/rmi/server/SkeletonNotFoundException.java \
-java/rmi/server/SocketSecurityException.java \
-java/rmi/server/UID.java \
-java/rmi/server/UnicastRemoteObject.java \
-java/rmi/server/Unreferenced.java \
-gnu/java/rmi/dgc/DGCImpl.java \
-gnu/java/rmi/dgc/DGCImpl_Skel.java \
-gnu/java/rmi/dgc/DGCImpl_Stub.java \
-gnu/java/rmi/registry/RegistryImpl.java \
-gnu/java/rmi/registry/RegistryImpl_Skel.java \
-gnu/java/rmi/registry/RegistryImpl_Stub.java \
-gnu/java/rmi/rmic/Compile_gcj.java \
-gnu/java/rmi/rmic/Compiler.java \
-gnu/java/rmi/rmic/CompilerProcess.java \
-gnu/java/rmi/rmic/RMIC.java \
-gnu/java/rmi/rmic/TabbedWriter.java \
-gnu/java/rmi/server/ProtocolConstants.java \
-gnu/java/rmi/server/RMIDefaultSocketFactory.java \
-gnu/java/rmi/server/RMIHashes.java \
-gnu/java/rmi/server/RMIObjectInputStream.java \
-gnu/java/rmi/server/RMIObjectOutputStream.java \
-gnu/java/rmi/server/UnicastConnection.java \
-gnu/java/rmi/server/UnicastConnectionManager.java \
-gnu/java/rmi/server/UnicastRef.java \
-gnu/java/rmi/server/UnicastRemoteCall.java \
-gnu/java/rmi/server/UnicastRemoteStub.java \
-gnu/java/rmi/server/UnicastServer.java \
-gnu/java/rmi/server/UnicastServerRef.java
-
-
-built_java_source_files = java/lang/ConcreteProcess.java \
- gnu/classpath/Configuration.java
-
-
-core_java_source_files = \
-java/lang/AbstractMethodError.java \
-java/lang/ArithmeticException.java \
-java/lang/ArrayIndexOutOfBoundsException.java \
-java/lang/ArrayStoreException.java \
-java/lang/Boolean.java \
-java/lang/Byte.java \
-java/lang/Character.java \
-java/lang/CharSequence.java \
-java/lang/ClassCastException.java \
-java/lang/ClassCircularityError.java \
-java/lang/ClassFormatError.java \
-java/lang/ClassLoader.java \
-java/lang/ClassNotFoundException.java \
-java/lang/CloneNotSupportedException.java \
-java/lang/Cloneable.java \
-java/lang/Comparable.java \
-java/lang/Compiler.java \
-java/lang/Double.java \
-java/lang/Error.java \
-java/lang/Exception.java \
-java/lang/ExceptionInInitializerError.java \
-java/lang/Float.java \
-java/lang/IllegalAccessError.java \
-java/lang/IllegalAccessException.java \
-java/lang/IllegalArgumentException.java \
-java/lang/IllegalMonitorStateException.java \
-java/lang/IllegalStateException.java \
-java/lang/IllegalThreadStateException.java \
-java/lang/IncompatibleClassChangeError.java \
-java/lang/IndexOutOfBoundsException.java \
-java/lang/InheritableThreadLocal.java \
-java/lang/InstantiationError.java \
-java/lang/InstantiationException.java \
-java/lang/Integer.java \
-java/lang/InternalError.java \
-java/lang/InterruptedException.java \
-java/lang/LinkageError.java \
-java/lang/Long.java \
-java/lang/Math.java \
-java/lang/NegativeArraySizeException.java \
-java/lang/NoClassDefFoundError.java \
-java/lang/NoSuchFieldError.java \
-java/lang/NoSuchFieldException.java \
-java/lang/NoSuchMethodError.java \
-java/lang/NoSuchMethodException.java \
-java/lang/NullPointerException.java \
-java/lang/Number.java \
-java/lang/NumberFormatException.java \
-java/lang/OutOfMemoryError.java \
-java/lang/Package.java \
-java/lang/Process.java \
-java/lang/Runnable.java \
-java/lang/Runtime.java \
-java/lang/RuntimeException.java \
-java/lang/RuntimePermission.java \
-java/lang/SecurityException.java \
-java/lang/SecurityManager.java \
-java/lang/Short.java \
-java/lang/StackOverflowError.java \
-java/lang/String.java \
-java/lang/StringBuffer.java \
-java/lang/StringIndexOutOfBoundsException.java \
-java/lang/System.java \
-java/lang/Thread.java \
-java/lang/ThreadDeath.java \
-java/lang/ThreadGroup.java \
-java/lang/ThreadLocal.java \
-java/lang/Throwable.java \
-java/lang/UnknownError.java \
-java/lang/UnsatisfiedLinkError.java \
-java/lang/UnsupportedClassVersionError.java \
-java/lang/UnsupportedOperationException.java \
-java/lang/VerifyError.java \
-java/lang/VirtualMachineError.java \
-java/lang/VMClassLoader.java \
-java/lang/VMSecurityManager.java \
-java/lang/Void.java \
-java/io/BufferedInputStream.java \
-java/io/BufferedOutputStream.java \
-java/io/BufferedReader.java \
-java/io/BufferedWriter.java \
-java/io/ByteArrayInputStream.java \
-java/io/ByteArrayOutputStream.java \
-java/io/CharArrayReader.java \
-java/io/CharArrayWriter.java \
-java/io/CharConversionException.java \
-java/io/DataInput.java \
-java/io/DataInputStream.java \
-java/io/DataOutput.java \
-java/io/DataOutputStream.java \
-java/io/EOFException.java \
-java/io/Externalizable.java \
-java/io/File.java \
-java/io/FileDescriptor.java \
-java/io/FileFilter.java \
-java/io/FileInputStream.java \
-java/io/FileNotFoundException.java \
-java/io/FileOutputStream.java \
-java/io/FilePermission.java \
-java/io/FileReader.java \
-java/io/FileWriter.java \
-java/io/FilenameFilter.java \
-java/io/FilterInputStream.java \
-java/io/FilterOutputStream.java \
-java/io/FilterReader.java \
-java/io/FilterWriter.java \
-java/io/IOException.java \
-java/io/InputStream.java \
-java/io/InputStreamReader.java \
-java/io/InterruptedIOException.java \
-java/io/InvalidClassException.java \
-java/io/InvalidObjectException.java \
-java/io/LineNumberInputStream.java \
-java/io/LineNumberReader.java \
-java/io/NotActiveException.java \
-java/io/NotSerializableException.java \
-java/io/ObjectInput.java \
-java/io/ObjectInputStream.java \
-java/io/ObjectInputValidation.java \
-java/io/ObjectOutput.java \
-java/io/ObjectOutputStream.java \
-java/io/ObjectStreamClass.java \
-java/io/ObjectStreamConstants.java \
-java/io/ObjectStreamException.java \
-java/io/ObjectStreamField.java \
-java/io/OptionalDataException.java \
-java/io/OutputStream.java \
-java/io/OutputStreamWriter.java \
-java/io/PipedInputStream.java \
-java/io/PipedOutputStream.java \
-java/io/PipedReader.java \
-java/io/PipedWriter.java \
-java/io/PrintStream.java \
-java/io/PrintWriter.java \
-java/io/PushbackInputStream.java \
-java/io/PushbackReader.java \
-java/io/RandomAccessFile.java \
-java/io/Reader.java \
-java/io/SequenceInputStream.java \
-java/io/Serializable.java \
-java/io/SerializablePermission.java \
-java/io/StreamCorruptedException.java \
-java/io/StreamTokenizer.java \
-java/io/StringBufferInputStream.java \
-java/io/StringReader.java \
-java/io/StringWriter.java \
-java/io/SyncFailedException.java \
-java/io/UTFDataFormatException.java \
-java/io/UnsupportedEncodingException.java \
-java/io/WriteAbortedException.java \
-java/io/Writer.java \
-java/util/AbstractCollection.java \
-java/util/AbstractList.java \
-java/util/AbstractMap.java \
-java/util/AbstractSequentialList.java \
-java/util/AbstractSet.java \
-java/util/ArrayList.java \
-java/util/Arrays.java \
-java/util/BasicMapEntry.java \
-java/util/BitSet.java \
-java/util/Calendar.java \
-java/util/Collection.java \
-java/util/Collections.java \
-java/util/Comparator.java \
-java/util/ConcurrentModificationException.java \
-java/util/Date.java \
-java/util/Dictionary.java \
-java/util/EmptyStackException.java \
-java/util/Enumeration.java \
-java/util/EventListener.java \
-java/util/EventObject.java \
-java/util/GregorianCalendar.java \
-java/util/HashMap.java \
-java/util/HashSet.java \
-java/util/Hashtable.java \
-java/util/IdentityHashMap.java \
-java/util/Iterator.java \
-java/util/LinkedList.java \
-java/util/List.java \
-java/util/ListIterator.java \
-java/util/ListResourceBundle.java \
-java/util/Locale.java \
-java/util/Map.java \
-java/util/MissingResourceException.java \
-java/util/NoSuchElementException.java \
-java/util/Observable.java \
-java/util/Observer.java \
-java/util/Properties.java \
-java/util/PropertyPermission.java \
-java/util/PropertyResourceBundle.java \
-java/util/Random.java \
-java/util/ResourceBundle.java \
-java/util/Set.java \
-java/util/SimpleTimeZone.java \
-java/util/SortedMap.java \
-java/util/SortedSet.java \
-java/util/Stack.java \
-java/util/StringTokenizer.java \
-java/util/TimeZone.java \
-java/util/Timer.java \
-java/util/TimerTask.java \
-java/util/TreeMap.java \
-java/util/TreeSet.java \
-java/util/TooManyListenersException.java \
-java/util/Vector.java \
-java/util/WeakHashMap.java
-
-
-ordinary_java_source_files = $(core_java_source_files) \
-gnu/gcj/Core.java \
-gnu/gcj/RawData.java \
-gnu/gcj/io/DefaultMimeTypes.java \
-gnu/gcj/io/MimeTypes.java \
-gnu/gcj/io/SimpleSHSStream.java \
-gnu/gcj/math/MPN.java \
-gnu/gcj/protocol/core/Connection.java \
-gnu/gcj/protocol/core/Handler.java \
-gnu/gcj/protocol/core/CoreInputStream.java \
-gnu/gcj/protocol/file/Connection.java \
-gnu/gcj/protocol/file/Handler.java \
-gnu/gcj/protocol/http/Connection.java \
-gnu/gcj/protocol/http/Handler.java \
-gnu/gcj/protocol/jar/Connection.java \
-gnu/gcj/protocol/jar/Handler.java \
-gnu/gcj/runtime/FileDeleter.java \
-gnu/gcj/runtime/FinalizerThread.java \
-gnu/gcj/runtime/FirstThread.java \
-gnu/gcj/runtime/SharedLibLoader.java \
-gnu/gcj/runtime/VMClassLoader.java \
-gnu/java/io/ClassLoaderObjectInputStream.java \
-gnu/java/io/NullOutputStream.java \
-gnu/java/io/ObjectIdentityWrapper.java \
-gnu/java/lang/ArrayHelper.java \
-gnu/java/lang/ClassHelper.java \
-gnu/java/lang/reflect/TypeSignature.java \
-gnu/java/locale/Calendar.java \
-gnu/java/locale/Calendar_de.java \
-gnu/java/locale/Calendar_en.java \
-gnu/java/locale/Calendar_nl.java \
-gnu/java/locale/LocaleInformation.java \
-gnu/java/locale/LocaleInformation_de.java \
-gnu/java/locale/LocaleInformation_en.java \
-gnu/java/locale/LocaleInformation_en_US.java \
-gnu/java/locale/LocaleInformation_nl.java \
-gnu/java/security/provider/DefaultPolicy.java \
-gnu/java/security/provider/Gnu.java \
-gnu/java/security/provider/SHA.java \
-gnu/java/security/provider/SHA1PRNG.java \
-gnu/java/text/BaseBreakIterator.java \
-gnu/java/text/CharacterBreakIterator.java \
-gnu/java/text/LineBreakIterator.java \
-gnu/java/text/SentenceBreakIterator.java \
-gnu/java/text/WordBreakIterator.java \
-gnu/java/util/DoubleEnumeration.java \
-java/lang/ref/PhantomReference.java \
-java/lang/ref/Reference.java \
-java/lang/ref/ReferenceQueue.java \
-java/lang/ref/SoftReference.java \
-java/lang/ref/WeakReference.java \
-java/lang/reflect/AccessibleObject.java \
-java/lang/reflect/Array.java \
-java/lang/reflect/Constructor.java \
-java/lang/reflect/Field.java \
-java/lang/reflect/InvocationTargetException.java \
-java/lang/reflect/Member.java \
-java/lang/reflect/Method.java \
-java/lang/reflect/Modifier.java \
-java/lang/reflect/ReflectPermission.java \
-java/math/BigDecimal.java \
-java/math/BigInteger.java \
-java/net/Authenticator.java \
-java/net/BindException.java \
-java/net/ConnectException.java \
-java/net/ContentHandler.java \
-java/net/ContentHandlerFactory.java \
-java/net/DatagramPacket.java \
-java/net/DatagramSocket.java \
-java/net/DatagramSocketImpl.java \
-java/net/FileNameMap.java \
-java/net/HttpURLConnection.java \
-java/net/InetAddress.java \
-java/net/JarURLConnection.java \
-java/net/MalformedURLException.java \
-java/net/MulticastSocket.java \
-java/net/NetPermission.java \
-java/net/NoRouteToHostException.java \
-java/net/PasswordAuthentication.java \
-java/net/PlainDatagramSocketImpl.java \
-java/net/PlainSocketImpl.java \
-java/net/ProtocolException.java \
-java/net/ServerSocket.java \
-java/net/Socket.java \
-java/net/SocketException.java \
-java/net/SocketImpl.java \
-java/net/SocketImplFactory.java \
-java/net/SocketOptions.java \
-java/net/SocketPermission.java \
-java/net/URL.java \
-java/net/URLClassLoader.java \
-java/net/URLConnection.java \
-java/net/URLDecoder.java \
-java/net/URLEncoder.java \
-java/net/URLStreamHandler.java \
-java/net/URLStreamHandlerFactory.java \
-java/net/UnknownHostException.java \
-java/net/UnknownServiceException.java \
-java/security/AccessControlContext.java \
-java/security/AccessControlException.java \
-java/security/AccessController.java \
-java/security/AlgorithmParameterGenerator.java \
-java/security/AlgorithmParameters.java \
-java/security/AlgorithmParameterGeneratorSpi.java \
-java/security/AlgorithmParametersSpi.java \
-java/security/AllPermission.java \
-java/security/BasicPermission.java \
-java/security/Certificate.java \
-java/security/CodeSource.java \
-java/security/DigestException.java \
-java/security/DigestOutputStream.java \
-java/security/DummyKeyPairGenerator.java \
-java/security/DummySignature.java \
-java/security/DigestInputStream.java \
-java/security/DomainCombiner.java \
-java/security/DummyMessageDigest.java \
-java/security/GeneralSecurityException.java \
-java/security/Guard.java \
-java/security/GuardedObject.java \
-java/security/Identity.java \
-java/security/IdentityScope.java \
-java/security/InvalidAlgorithmParameterException.java \
-java/security/InvalidKeyException.java \
-java/security/InvalidParameterException.java \
-java/security/Key.java \
-java/security/KeyFactorySpi.java \
-java/security/KeyPairGenerator.java \
-java/security/KeyStoreException.java \
-java/security/KeyException.java \
-java/security/KeyManagementException.java \
-java/security/KeyPairGeneratorSpi.java \
-java/security/KeyStoreSpi.java \
-java/security/KeyFactory.java \
-java/security/KeyPair.java \
-java/security/KeyStore.java \
-java/security/MessageDigest.java \
-java/security/MessageDigestSpi.java \
-java/security/NoSuchAlgorithmException.java \
-java/security/NoSuchProviderException.java \
-java/security/Permission.java \
-java/security/Principal.java \
-java/security/PrivilegedExceptionAction.java \
-java/security/PublicKey.java \
-java/security/PermissionCollection.java \
-java/security/PrivateKey.java \
-java/security/ProtectionDomain.java \
-java/security/Permissions.java \
-java/security/PrivilegedAction.java \
-java/security/Provider.java \
-java/security/Policy.java \
-java/security/PrivilegedActionException.java \
-java/security/ProviderException.java \
-java/security/SecureClassLoader.java \
-java/security/SecureRandomSpi.java \
-java/security/SecurityPermission.java \
-java/security/SignatureException.java \
-java/security/SignedObject.java \
-java/security/SecureRandom.java \
-java/security/Security.java \
-java/security/Signature.java \
-java/security/SignatureSpi.java \
-java/security/Signer.java \
-java/security/UnrecoverableKeyException.java \
-java/security/UnresolvedPermission.java \
-java/security/acl/Acl.java \
-java/security/acl/AclNotFoundException.java \
-java/security/acl/LastOwnerException.java \
-java/security/acl/Owner.java \
-java/security/acl/AclEntry.java \
-java/security/acl/Group.java \
-java/security/acl/NotOwnerException.java \
-java/security/acl/Permission.java \
-java/security/cert/CRL.java \
-java/security/cert/CRLException.java \
-java/security/cert/Certificate.java \
-java/security/cert/CertificateEncodingException.java \
-java/security/cert/CertificateException.java \
-java/security/cert/CertificateExpiredException.java \
-java/security/cert/CertificateFactory.java \
-java/security/cert/CertificateFactorySpi.java \
-java/security/cert/CertificateNotYetValidException.java \
-java/security/cert/CertificateParsingException.java \
-java/security/cert/X509CRL.java \
-java/security/cert/X509CRLEntry.java \
-java/security/cert/X509Certificate.java \
-java/security/cert/X509Extension.java \
-java/security/interfaces/DSAKey.java \
-java/security/interfaces/DSAKeyPairGenerator.java \
-java/security/interfaces/DSAParams.java \
-java/security/interfaces/DSAPrivateKey.java \
-java/security/interfaces/DSAPublicKey.java \
-java/security/interfaces/RSAKey.java \
-java/security/interfaces/RSAPrivateCrtKey.java \
-java/security/interfaces/RSAPrivateKey.java \
-java/security/interfaces/RSAPublicKey.java \
-java/security/spec/AlgorithmParameterSpec.java \
-java/security/spec/DSAParameterSpec.java \
-java/security/spec/DSAPrivateKeySpec.java \
-java/security/spec/DSAPublicKeySpec.java \
-java/security/spec/EncodedKeySpec.java \
-java/security/spec/InvalidKeySpecException.java \
-java/security/spec/InvalidParameterSpecException.java \
-java/security/spec/KeySpec.java \
-java/security/spec/PKCS8EncodedKeySpec.java \
-java/security/spec/RSAKeyGenParameterSpec.java \
-java/security/spec/RSAPrivateCrtKeySpec.java \
-java/security/spec/RSAPrivateKeySpec.java \
-java/security/spec/RSAPublicKeySpec.java \
-java/security/spec/X509EncodedKeySpec.java \
-java/sql/Array.java \
-java/sql/BatchUpdateException.java \
-java/sql/Blob.java \
-java/sql/CallableStatement.java \
-java/sql/Clob.java \
-java/sql/Connection.java \
-java/sql/DataTruncation.java \
-java/sql/DatabaseMetaData.java \
-java/sql/Date.java \
-java/sql/Driver.java \
-java/sql/DriverManager.java \
-java/sql/DriverPropertyInfo.java \
-java/sql/PreparedStatement.java \
-java/sql/Ref.java \
-java/sql/ResultSet.java \
-java/sql/ResultSetMetaData.java \
-java/sql/SQLData.java \
-java/sql/SQLException.java \
-java/sql/SQLInput.java \
-java/sql/SQLOutput.java \
-java/sql/SQLWarning.java \
-java/sql/Statement.java \
-java/sql/Struct.java \
-java/sql/Time.java \
-java/sql/Timestamp.java \
-java/sql/Types.java \
-java/text/Annotation.java \
-java/text/AttributedCharacterIterator.java \
-java/text/AttributedString.java \
-java/text/AttributedStringIterator.java \
-java/text/BreakIterator.java \
-java/text/CharacterIterator.java \
-java/text/ChoiceFormat.java \
-java/text/CollationElementIterator.java \
-java/text/CollationKey.java \
-java/text/Collator.java \
-java/text/DateFormat.java \
-java/text/DateFormatSymbols.java \
-java/text/DecimalFormat.java \
-java/text/DecimalFormatSymbols.java \
-java/text/FieldPosition.java \
-java/text/Format.java \
-java/text/MessageFormat.java \
-java/text/NumberFormat.java \
-java/text/ParseException.java \
-java/text/ParsePosition.java \
-java/text/RuleBasedCollator.java \
-java/text/SimpleDateFormat.java \
-java/text/StringCharacterIterator.java \
-java/util/jar/Attributes.java \
-java/util/jar/JarEntry.java \
-java/util/jar/JarException.java \
-java/util/jar/JarFile.java \
-java/util/jar/JarInputStream.java \
-java/util/jar/JarOutputStream.java \
-java/util/jar/Manifest.java \
-java/util/zip/Adler32.java \
-java/util/zip/CRC32.java \
-java/util/zip/CheckedInputStream.java \
-java/util/zip/CheckedOutputStream.java \
-java/util/zip/Checksum.java \
-java/util/zip/DataFormatException.java \
-java/util/zip/Deflater.java \
-java/util/zip/DeflaterOutputStream.java \
-java/util/zip/GZIPInputStream.java \
-java/util/zip/GZIPOutputStream.java \
-java/util/zip/Inflater.java \
-java/util/zip/InflaterInputStream.java \
-java/util/zip/ZipConstants.java \
-java/util/zip/ZipEntry.java \
-java/util/zip/ZipException.java \
-java/util/zip/ZipFile.java \
-java/util/zip/ZipInputStream.java \
-java/util/zip/ZipOutputStream.java \
-org/w3c/dom/Attr.java \
-org/w3c/dom/CDATASection.java \
-org/w3c/dom/CharacterData.java \
-org/w3c/dom/Comment.java \
-org/w3c/dom/DOMException.java \
-org/w3c/dom/DOMImplementation.java \
-org/w3c/dom/Document.java \
-org/w3c/dom/DocumentFragment.java \
-org/w3c/dom/DocumentType.java \
-org/w3c/dom/Element.java \
-org/w3c/dom/Entity.java \
-org/w3c/dom/EntityReference.java \
-org/w3c/dom/NamedNodeMap.java \
-org/w3c/dom/Node.java \
-org/w3c/dom/NodeList.java \
-org/w3c/dom/Notation.java \
-org/w3c/dom/ProcessingInstruction.java \
-org/w3c/dom/Text.java \
-org/w3c/dom/ranges/DocumentRange.java \
-org/w3c/dom/ranges/Range.java \
-org/w3c/dom/ranges/RangeException.java \
-org/w3c/dom/traversal/DocumentTraversal.java \
-org/w3c/dom/traversal/NodeFilter.java \
-org/w3c/dom/traversal/NodeIterator.java \
-org/w3c/dom/traversal/TreeWalker.java \
-org/xml/sax/ext/DeclHandler.java \
-org/xml/sax/ext/LexicalHandler.java \
-org/xml/sax/helpers/AttributeListImpl.java \
-org/xml/sax/helpers/AttributesImpl.java \
-org/xml/sax/helpers/DefaultHandler.java \
-org/xml/sax/helpers/LocatorImpl.java \
-org/xml/sax/helpers/NamespaceSupport.java \
-org/xml/sax/helpers/ParserAdapter.java \
-org/xml/sax/helpers/ParserFactory.java \
-org/xml/sax/helpers/XMLFilterImpl.java \
-org/xml/sax/helpers/XMLReaderAdapter.java \
-org/xml/sax/helpers/XMLReaderFactory.java \
-org/xml/sax/AttributeList.java \
-org/xml/sax/Attributes.java \
-org/xml/sax/ContentHandler.java \
-org/xml/sax/DTDHandler.java \
-org/xml/sax/DocumentHandler.java \
-org/xml/sax/EntityResolver.java \
-org/xml/sax/ErrorHandler.java \
-org/xml/sax/HandlerBase.java \
-org/xml/sax/InputSource.java \
-org/xml/sax/Locator.java \
-org/xml/sax/Parser.java \
-org/xml/sax/SAXException.java \
-org/xml/sax/SAXNotRecognizedException.java \
-org/xml/sax/SAXNotSupportedException.java \
-org/xml/sax/SAXParseException.java \
-org/xml/sax/XMLFilter.java \
-org/xml/sax/XMLReader.java \
-$(rmi_java_source_files) \
-$(awt_java_source_files) \
-$(convert_source_files)
+awt_java_source_files = gnu/awt/LightweightRedirector.java gnu/awt/j2d/AbstractGraphicsState.java gnu/awt/j2d/DirectRasterGraphics.java gnu/awt/j2d/Graphics2DImpl.java gnu/awt/j2d/IntegerGraphicsState.java gnu/awt/j2d/MappedRaster.java gnu/gcj/awt/BitMaskExtent.java gnu/gcj/awt/Buffers.java gnu/gcj/awt/ComponentDataBlitOp.java gnu/gcj/awt/GLightweightPeer.java gnu/java/beans/editors/ColorEditor.java gnu/java/beans/editors/FontEditor.java gnu/java/beans/editors/NativeBooleanEditor.java gnu/java/beans/editors/NativeByteEditor.java gnu/java/beans/editors/NativeDoubleEditor.java gnu/java/beans/editors/NativeFloatEditor.java gnu/java/beans/editors/NativeIntEditor.java gnu/java/beans/editors/NativeLongEditor.java gnu/java/beans/editors/NativeShortEditor.java gnu/java/beans/editors/StringEditor.java gnu/java/beans/info/ComponentBeanInfo.java gnu/java/beans/BeanInfoEmbryo.java gnu/java/beans/EmptyBeanInfo.java gnu/java/beans/ExplicitBeanInfo.java gnu/java/beans/IntrospectionIncubator.java java/applet/Applet.java java/applet/AppletStub.java java/applet/AppletContext.java java/applet/AudioClip.java java/awt/AWTError.java java/awt/AWTEvent.java java/awt/AWTEventMulticaster.java java/awt/AWTException.java java/awt/AWTPermission.java java/awt/ActiveEvent.java java/awt/Adjustable.java java/awt/BorderLayout.java java/awt/Button.java java/awt/Canvas.java java/awt/CardLayout.java java/awt/Checkbox.java java/awt/CheckboxGroup.java java/awt/CheckboxMenuItem.java java/awt/Choice.java java/awt/Color.java java/awt/Component.java java/awt/ComponentOrientation.java java/awt/Container.java java/awt/Cursor.java java/awt/Dialog.java java/awt/Dimension.java java/awt/Event.java java/awt/EventDispatchThread.java java/awt/EventQueue.java java/awt/FileDialog.java java/awt/FlowLayout.java java/awt/Font.java java/awt/FontMetrics.java java/awt/Frame.java java/awt/Graphics.java java/awt/Graphics2D.java java/awt/GraphicsConfiguration.java java/awt/GridBagConstraints.java java/awt/GridLayout.java java/awt/IllegalComponentStateException.java java/awt/Image.java java/awt/Insets.java java/awt/ItemSelectable.java java/awt/Label.java java/awt/LayoutManager.java java/awt/LayoutManager2.java java/awt/List.java java/awt/Menu.java java/awt/MenuBar.java java/awt/MenuComponent.java java/awt/MenuContainer.java java/awt/MenuItem.java java/awt/MenuShortcut.java java/awt/Paint.java java/awt/PaintContext.java java/awt/Panel.java java/awt/Point.java java/awt/Polygon.java java/awt/PopupMenu.java java/awt/Rectangle.java java/awt/RenderingHints.java java/awt/ScrollPane.java java/awt/Scrollbar.java java/awt/Shape.java java/awt/SystemColor.java java/awt/TextArea.java java/awt/TextComponent.java java/awt/TextField.java java/awt/Toolkit.java java/awt/Transparency.java java/awt/Window.java java/awt/color/ColorSpace.java java/awt/color/ICC_ColorSpace.java java/awt/color/ICC_Profile.java java/awt/datatransfer/Clipboard.java java/awt/event/AWTEventListener.java java/awt/event/ActionEvent.java java/awt/event/ActionListener.java java/awt/event/AdjustmentEvent.java java/awt/event/AdjustmentListener.java java/awt/event/ComponentAdapter.java java/awt/event/ComponentEvent.java java/awt/event/ComponentListener.java java/awt/event/ContainerAdapter.java java/awt/event/ContainerEvent.java java/awt/event/ContainerListener.java java/awt/event/FocusAdapter.java java/awt/event/FocusEvent.java java/awt/event/FocusListener.java java/awt/event/HierarchyBoundsAdapter.java java/awt/event/HierarchyBoundsListener.java java/awt/event/HierarchyEvent.java java/awt/event/HierarchyListener.java java/awt/event/InputEvent.java java/awt/event/InputMethodEvent.java java/awt/event/InputMethodListener.java java/awt/event/InvocationEvent.java java/awt/event/ItemEvent.java java/awt/event/ItemListener.java java/awt/event/KeyAdapter.java java/awt/event/KeyEvent.java java/awt/event/KeyListener.java java/awt/event/MouseAdapter.java java/awt/event/MouseEvent.java java/awt/event/MouseListener.java java/awt/event/MouseMotionAdapter.java java/awt/event/MouseMotionListener.java java/awt/event/PaintEvent.java java/awt/event/TextEvent.java java/awt/event/TextListener.java java/awt/event/WindowAdapter.java java/awt/event/WindowEvent.java java/awt/event/WindowListener.java java/awt/geom/AffineTransform.java java/awt/geom/Dimension2D.java java/awt/geom/Ellipse2D.java java/awt/geom/IllegalPathStateException.java java/awt/geom/Line2D.java java/awt/geom/NoninvertibleTransformException.java java/awt/geom/PathIterator.java java/awt/geom/Point2D.java java/awt/geom/Rectangle2D.java java/awt/geom/RectangularShape.java java/awt/geom/RoundRectangle2D.java java/awt/image/BufferedImage.java java/awt/image/ColorModel.java java/awt/image/ComponentColorModel.java java/awt/image/ComponentSampleModel.java java/awt/image/DataBuffer.java java/awt/image/DataBufferByte.java java/awt/image/DataBufferInt.java java/awt/image/DataBufferUShort.java java/awt/image/DirectColorModel.java java/awt/image/ImageConsumer.java java/awt/image/ImageObserver.java java/awt/image/ImageProducer.java java/awt/image/IndexColorModel.java java/awt/image/PackedColorModel.java java/awt/image/Raster.java java/awt/image/RasterOp.java java/awt/image/SampleModel.java java/awt/image/SinglePixelPackedSampleModel.java java/awt/image/WritableRaster.java java/awt/peer/ButtonPeer.java java/awt/peer/CanvasPeer.java java/awt/peer/CheckboxMenuItemPeer.java java/awt/peer/CheckboxPeer.java java/awt/peer/ChoicePeer.java java/awt/peer/ComponentPeer.java java/awt/peer/ContainerPeer.java java/awt/peer/DialogPeer.java java/awt/peer/FileDialogPeer.java java/awt/peer/FontPeer.java java/awt/peer/FramePeer.java java/awt/peer/LabelPeer.java java/awt/peer/LightweightPeer.java java/awt/peer/ListPeer.java java/awt/peer/MenuBarPeer.java java/awt/peer/MenuComponentPeer.java java/awt/peer/MenuItemPeer.java java/awt/peer/MenuPeer.java java/awt/peer/PanelPeer.java java/awt/peer/PopupMenuPeer.java java/awt/peer/ScrollPanePeer.java java/awt/peer/ScrollbarPeer.java java/awt/peer/TextAreaPeer.java java/awt/peer/TextComponentPeer.java java/awt/peer/TextFieldPeer.java java/awt/peer/WindowPeer.java java/beans/beancontext/BeanContext.java java/beans/beancontext/BeanContextChild.java java/beans/beancontext/BeanContextChildComponentProxy.java java/beans/beancontext/BeanContextChildSupport.java java/beans/beancontext/BeanContextContainerProxy.java java/beans/beancontext/BeanContextEvent.java java/beans/beancontext/BeanContextMembershipEvent.java java/beans/beancontext/BeanContextMembershipListener.java java/beans/beancontext/BeanContextProxy.java java/beans/beancontext/BeanContextServiceAvailableEvent.java java/beans/beancontext/BeanContextServiceProvider.java java/beans/beancontext/BeanContextServiceProviderBeanInfo.java java/beans/beancontext/BeanContextServiceRevokedEvent.java java/beans/beancontext/BeanContextServiceRevokedListener.java java/beans/beancontext/BeanContextServices.java java/beans/beancontext/BeanContextServicesListener.java java/beans/AppletInitializer.java java/beans/BeanDescriptor.java java/beans/BeanInfo.java java/beans/Beans.java java/beans/Customizer.java java/beans/DesignMode.java java/beans/EventSetDescriptor.java java/beans/FeatureDescriptor.java java/beans/IndexedPropertyDescriptor.java java/beans/IntrospectionException.java java/beans/Introspector.java java/beans/MethodDescriptor.java java/beans/ParameterDescriptor.java java/beans/PropertyChangeEvent.java java/beans/PropertyChangeListener.java java/beans/PropertyChangeSupport.java java/beans/PropertyDescriptor.java java/beans/PropertyEditor.java java/beans/PropertyEditorManager.java java/beans/PropertyEditorSupport.java java/beans/PropertyVetoException.java java/beans/SimpleBeanInfo.java java/beans/VetoableChangeListener.java java/beans/VetoableChangeSupport.java java/beans/Visibility.java
+
+
+rmi_java_source_files = java/rmi/activation/Activatable.java java/rmi/activation/ActivateFailedException.java java/rmi/activation/ActivationDesc.java java/rmi/activation/ActivationException.java java/rmi/activation/ActivationGroup.java java/rmi/activation/ActivationGroupDesc.java java/rmi/activation/ActivationGroupID.java java/rmi/activation/ActivationID.java java/rmi/activation/ActivationInstantiator.java java/rmi/activation/ActivationMonitor.java java/rmi/activation/ActivationSystem.java java/rmi/activation/Activator.java java/rmi/activation/UnknownGroupException.java java/rmi/activation/UnknownObjectException.java java/rmi/AccessException.java java/rmi/AlreadyBoundException.java java/rmi/ConnectException.java java/rmi/ConnectIOException.java java/rmi/MarshalException.java java/rmi/MarshalledObject.java java/rmi/Naming.java java/rmi/NoSuchObjectException.java java/rmi/NotBoundException.java java/rmi/RMISecurityException.java java/rmi/RMISecurityManager.java java/rmi/Remote.java java/rmi/RemoteException.java java/rmi/ServerError.java java/rmi/ServerException.java java/rmi/ServerRuntimeException.java java/rmi/StubNotFoundException.java java/rmi/UnexpectedException.java java/rmi/UnknownHostException.java java/rmi/UnmarshalException.java java/rmi/dgc/DGC.java java/rmi/dgc/Lease.java java/rmi/dgc/VMID.java java/rmi/registry/LocateRegistry.java java/rmi/registry/Registry.java java/rmi/registry/RegistryHandler.java java/rmi/server/ExportException.java java/rmi/server/LoaderHandler.java java/rmi/server/LogStream.java java/rmi/server/ObjID.java java/rmi/server/Operation.java java/rmi/server/RMIClassLoader.java java/rmi/server/RMIClientSocketFactory.java java/rmi/server/RMIFailureHandler.java java/rmi/server/RMIServerSocketFactory.java java/rmi/server/RMISocketFactory.java java/rmi/server/RemoteCall.java java/rmi/server/RemoteObject.java java/rmi/server/RemoteRef.java java/rmi/server/RemoteServer.java java/rmi/server/RemoteStub.java java/rmi/server/ServerCloneException.java java/rmi/server/ServerNotActiveException.java java/rmi/server/ServerRef.java java/rmi/server/Skeleton.java java/rmi/server/SkeletonMismatchException.java java/rmi/server/SkeletonNotFoundException.java java/rmi/server/SocketSecurityException.java java/rmi/server/UID.java java/rmi/server/UnicastRemoteObject.java java/rmi/server/Unreferenced.java gnu/java/rmi/dgc/DGCImpl.java gnu/java/rmi/dgc/DGCImpl_Skel.java gnu/java/rmi/dgc/DGCImpl_Stub.java gnu/java/rmi/registry/RegistryImpl.java gnu/java/rmi/registry/RegistryImpl_Skel.java gnu/java/rmi/registry/RegistryImpl_Stub.java gnu/java/rmi/rmic/Compile_gcj.java gnu/java/rmi/rmic/Compiler.java gnu/java/rmi/rmic/CompilerProcess.java gnu/java/rmi/rmic/RMIC.java gnu/java/rmi/rmic/TabbedWriter.java gnu/java/rmi/server/ProtocolConstants.java gnu/java/rmi/server/RMIDefaultSocketFactory.java gnu/java/rmi/server/RMIHashes.java gnu/java/rmi/server/RMIObjectInputStream.java gnu/java/rmi/server/RMIObjectOutputStream.java gnu/java/rmi/server/UnicastConnection.java gnu/java/rmi/server/UnicastConnectionManager.java gnu/java/rmi/server/UnicastRef.java gnu/java/rmi/server/UnicastRemoteCall.java gnu/java/rmi/server/UnicastRemoteStub.java gnu/java/rmi/server/UnicastServer.java gnu/java/rmi/server/UnicastServerRef.java
+
+
+built_java_source_files = java/lang/ConcreteProcess.java gnu/classpath/Configuration.java
+
+
+core_java_source_files = java/lang/AbstractMethodError.java java/lang/ArithmeticException.java java/lang/ArrayIndexOutOfBoundsException.java java/lang/ArrayStoreException.java java/lang/Boolean.java java/lang/Byte.java java/lang/Character.java java/lang/CharSequence.java java/lang/ClassCastException.java java/lang/ClassCircularityError.java java/lang/ClassFormatError.java java/lang/ClassLoader.java java/lang/ClassNotFoundException.java java/lang/CloneNotSupportedException.java java/lang/Cloneable.java java/lang/Comparable.java java/lang/Compiler.java java/lang/Double.java java/lang/Error.java java/lang/Exception.java java/lang/ExceptionInInitializerError.java java/lang/Float.java java/lang/IllegalAccessError.java java/lang/IllegalAccessException.java java/lang/IllegalArgumentException.java java/lang/IllegalMonitorStateException.java java/lang/IllegalStateException.java java/lang/IllegalThreadStateException.java java/lang/IncompatibleClassChangeError.java java/lang/IndexOutOfBoundsException.java java/lang/InheritableThreadLocal.java java/lang/InstantiationError.java java/lang/InstantiationException.java java/lang/Integer.java java/lang/InternalError.java java/lang/InterruptedException.java java/lang/LinkageError.java java/lang/Long.java java/lang/Math.java java/lang/NegativeArraySizeException.java java/lang/NoClassDefFoundError.java java/lang/NoSuchFieldError.java java/lang/NoSuchFieldException.java java/lang/NoSuchMethodError.java java/lang/NoSuchMethodException.java java/lang/NullPointerException.java java/lang/Number.java java/lang/NumberFormatException.java java/lang/OutOfMemoryError.java java/lang/Package.java java/lang/Process.java java/lang/Runnable.java java/lang/Runtime.java java/lang/RuntimeException.java java/lang/RuntimePermission.java java/lang/SecurityException.java java/lang/SecurityManager.java java/lang/Short.java java/lang/StackOverflowError.java java/lang/String.java java/lang/StringBuffer.java java/lang/StringIndexOutOfBoundsException.java java/lang/System.java java/lang/Thread.java java/lang/ThreadDeath.java java/lang/ThreadGroup.java java/lang/ThreadLocal.java java/lang/Throwable.java java/lang/UnknownError.java java/lang/UnsatisfiedLinkError.java java/lang/UnsupportedClassVersionError.java java/lang/UnsupportedOperationException.java java/lang/VerifyError.java java/lang/VirtualMachineError.java java/lang/VMClassLoader.java java/lang/VMSecurityManager.java java/lang/Void.java java/io/BufferedInputStream.java java/io/BufferedOutputStream.java java/io/BufferedReader.java java/io/BufferedWriter.java java/io/ByteArrayInputStream.java java/io/ByteArrayOutputStream.java java/io/CharArrayReader.java java/io/CharArrayWriter.java java/io/CharConversionException.java java/io/DataInput.java java/io/DataInputStream.java java/io/DataOutput.java java/io/DataOutputStream.java java/io/EOFException.java java/io/Externalizable.java java/io/File.java java/io/FileDescriptor.java java/io/FileFilter.java java/io/FileInputStream.java java/io/FileNotFoundException.java java/io/FileOutputStream.java java/io/FilePermission.java java/io/FileReader.java java/io/FileWriter.java java/io/FilenameFilter.java java/io/FilterInputStream.java java/io/FilterOutputStream.java java/io/FilterReader.java java/io/FilterWriter.java java/io/IOException.java java/io/InputStream.java java/io/InputStreamReader.java java/io/InterruptedIOException.java java/io/InvalidClassException.java java/io/InvalidObjectException.java java/io/LineNumberInputStream.java java/io/LineNumberReader.java java/io/NotActiveException.java java/io/NotSerializableException.java java/io/ObjectInput.java java/io/ObjectInputStream.java java/io/ObjectInputValidation.java java/io/ObjectOutput.java java/io/ObjectOutputStream.java java/io/ObjectStreamClass.java java/io/ObjectStreamConstants.java java/io/ObjectStreamException.java java/io/ObjectStreamField.java java/io/OptionalDataException.java java/io/OutputStream.java java/io/OutputStreamWriter.java java/io/PipedInputStream.java java/io/PipedOutputStream.java java/io/PipedReader.java java/io/PipedWriter.java java/io/PrintStream.java java/io/PrintWriter.java java/io/PushbackInputStream.java java/io/PushbackReader.java java/io/RandomAccessFile.java java/io/Reader.java java/io/SequenceInputStream.java java/io/Serializable.java java/io/SerializablePermission.java java/io/StreamCorruptedException.java java/io/StreamTokenizer.java java/io/StringBufferInputStream.java java/io/StringReader.java java/io/StringWriter.java java/io/SyncFailedException.java java/io/UTFDataFormatException.java java/io/UnsupportedEncodingException.java java/io/WriteAbortedException.java java/io/Writer.java java/util/AbstractCollection.java java/util/AbstractList.java java/util/AbstractMap.java java/util/AbstractSequentialList.java java/util/AbstractSet.java java/util/ArrayList.java java/util/Arrays.java java/util/BasicMapEntry.java java/util/BitSet.java java/util/Calendar.java java/util/Collection.java java/util/Collections.java java/util/Comparator.java java/util/ConcurrentModificationException.java java/util/Date.java java/util/Dictionary.java java/util/EmptyStackException.java java/util/Enumeration.java java/util/EventListener.java java/util/EventObject.java java/util/GregorianCalendar.java java/util/HashMap.java java/util/HashSet.java java/util/Hashtable.java java/util/IdentityHashMap.java java/util/Iterator.java java/util/LinkedList.java java/util/LinkedHashMap.java java/util/List.java java/util/ListIterator.java java/util/ListResourceBundle.java java/util/Locale.java java/util/Map.java java/util/MissingResourceException.java java/util/NoSuchElementException.java java/util/Observable.java java/util/Observer.java java/util/Properties.java java/util/PropertyPermission.java java/util/PropertyResourceBundle.java java/util/Random.java java/util/RandomAccess.java java/util/ResourceBundle.java java/util/Set.java java/util/SimpleTimeZone.java java/util/SortedMap.java java/util/SortedSet.java java/util/Stack.java java/util/StringTokenizer.java java/util/TimeZone.java java/util/Timer.java java/util/TimerTask.java java/util/TreeMap.java java/util/TreeSet.java java/util/TooManyListenersException.java java/util/Vector.java java/util/WeakHashMap.java
+
+
+ordinary_java_source_files = $(core_java_source_files) gnu/gcj/Core.java gnu/gcj/RawData.java gnu/gcj/io/DefaultMimeTypes.java gnu/gcj/io/MimeTypes.java gnu/gcj/io/SimpleSHSStream.java gnu/gcj/math/MPN.java gnu/gcj/protocol/core/Connection.java gnu/gcj/protocol/core/Handler.java gnu/gcj/protocol/core/CoreInputStream.java gnu/gcj/protocol/file/Connection.java gnu/gcj/protocol/file/Handler.java gnu/gcj/protocol/http/Connection.java gnu/gcj/protocol/http/Handler.java gnu/gcj/protocol/jar/Connection.java gnu/gcj/protocol/jar/Handler.java gnu/gcj/runtime/FileDeleter.java gnu/gcj/runtime/FinalizerThread.java gnu/gcj/runtime/FirstThread.java gnu/gcj/runtime/SharedLibLoader.java gnu/gcj/runtime/VMClassLoader.java gnu/java/io/ClassLoaderObjectInputStream.java gnu/java/io/NullOutputStream.java gnu/java/io/ObjectIdentityWrapper.java gnu/java/lang/ArrayHelper.java gnu/java/lang/ClassHelper.java gnu/java/lang/reflect/TypeSignature.java gnu/java/locale/Calendar.java gnu/java/locale/Calendar_de.java gnu/java/locale/Calendar_en.java gnu/java/locale/Calendar_nl.java gnu/java/locale/LocaleInformation.java gnu/java/locale/LocaleInformation_de.java gnu/java/locale/LocaleInformation_en.java gnu/java/locale/LocaleInformation_en_US.java gnu/java/locale/LocaleInformation_nl.java gnu/java/security/provider/DefaultPolicy.java gnu/java/security/provider/Gnu.java gnu/java/security/provider/SHA.java gnu/java/security/provider/SHA1PRNG.java gnu/java/text/BaseBreakIterator.java gnu/java/text/CharacterBreakIterator.java gnu/java/text/LineBreakIterator.java gnu/java/text/SentenceBreakIterator.java gnu/java/text/WordBreakIterator.java gnu/java/util/DoubleEnumeration.java java/lang/ref/PhantomReference.java java/lang/ref/Reference.java java/lang/ref/ReferenceQueue.java java/lang/ref/SoftReference.java java/lang/ref/WeakReference.java java/lang/reflect/AccessibleObject.java java/lang/reflect/Array.java java/lang/reflect/Constructor.java java/lang/reflect/Field.java java/lang/reflect/InvocationTargetException.java java/lang/reflect/Member.java java/lang/reflect/Method.java java/lang/reflect/Modifier.java java/lang/reflect/ReflectPermission.java java/math/BigDecimal.java java/math/BigInteger.java java/net/Authenticator.java java/net/BindException.java java/net/ConnectException.java java/net/ContentHandler.java java/net/ContentHandlerFactory.java java/net/DatagramPacket.java java/net/DatagramSocket.java java/net/DatagramSocketImpl.java java/net/FileNameMap.java java/net/HttpURLConnection.java java/net/InetAddress.java java/net/JarURLConnection.java java/net/MalformedURLException.java java/net/MulticastSocket.java java/net/NetPermission.java java/net/NoRouteToHostException.java java/net/PasswordAuthentication.java java/net/PlainDatagramSocketImpl.java java/net/PlainSocketImpl.java java/net/ProtocolException.java java/net/ServerSocket.java java/net/Socket.java java/net/SocketException.java java/net/SocketImpl.java java/net/SocketImplFactory.java java/net/SocketOptions.java java/net/SocketPermission.java java/net/URL.java java/net/URLClassLoader.java java/net/URLConnection.java java/net/URLDecoder.java java/net/URLEncoder.java java/net/URLStreamHandler.java java/net/URLStreamHandlerFactory.java java/net/UnknownHostException.java java/net/UnknownServiceException.java java/security/AccessControlContext.java java/security/AccessControlException.java java/security/AccessController.java java/security/AlgorithmParameterGenerator.java java/security/AlgorithmParameters.java java/security/AlgorithmParameterGeneratorSpi.java java/security/AlgorithmParametersSpi.java java/security/AllPermission.java java/security/BasicPermission.java java/security/Certificate.java java/security/CodeSource.java java/security/DigestException.java java/security/DigestOutputStream.java java/security/DummyKeyPairGenerator.java java/security/DummySignature.java java/security/DigestInputStream.java java/security/DomainCombiner.java java/security/DummyMessageDigest.java java/security/GeneralSecurityException.java java/security/Guard.java java/security/GuardedObject.java java/security/Identity.java java/security/IdentityScope.java java/security/InvalidAlgorithmParameterException.java java/security/InvalidKeyException.java java/security/InvalidParameterException.java java/security/Key.java java/security/KeyFactorySpi.java java/security/KeyPairGenerator.java java/security/KeyStoreException.java java/security/KeyException.java java/security/KeyManagementException.java java/security/KeyPairGeneratorSpi.java java/security/KeyStoreSpi.java java/security/KeyFactory.java java/security/KeyPair.java java/security/KeyStore.java java/security/MessageDigest.java java/security/MessageDigestSpi.java java/security/NoSuchAlgorithmException.java java/security/NoSuchProviderException.java java/security/Permission.java java/security/Principal.java java/security/PrivilegedExceptionAction.java java/security/PublicKey.java java/security/PermissionCollection.java java/security/PrivateKey.java java/security/ProtectionDomain.java java/security/Permissions.java java/security/PrivilegedAction.java java/security/Provider.java java/security/Policy.java java/security/PrivilegedActionException.java java/security/ProviderException.java java/security/SecureClassLoader.java java/security/SecureRandomSpi.java java/security/SecurityPermission.java java/security/SignatureException.java java/security/SignedObject.java java/security/SecureRandom.java java/security/Security.java java/security/Signature.java java/security/SignatureSpi.java java/security/Signer.java java/security/UnrecoverableKeyException.java java/security/UnresolvedPermission.java java/security/acl/Acl.java java/security/acl/AclNotFoundException.java java/security/acl/LastOwnerException.java java/security/acl/Owner.java java/security/acl/AclEntry.java java/security/acl/Group.java java/security/acl/NotOwnerException.java java/security/acl/Permission.java java/security/cert/CRL.java java/security/cert/CRLException.java java/security/cert/Certificate.java java/security/cert/CertificateEncodingException.java java/security/cert/CertificateException.java java/security/cert/CertificateExpiredException.java java/security/cert/CertificateFactory.java java/security/cert/CertificateFactorySpi.java java/security/cert/CertificateNotYetValidException.java java/security/cert/CertificateParsingException.java java/security/cert/X509CRL.java java/security/cert/X509CRLEntry.java java/security/cert/X509Certificate.java java/security/cert/X509Extension.java java/security/interfaces/DSAKey.java java/security/interfaces/DSAKeyPairGenerator.java java/security/interfaces/DSAParams.java java/security/interfaces/DSAPrivateKey.java java/security/interfaces/DSAPublicKey.java java/security/interfaces/RSAKey.java java/security/interfaces/RSAPrivateCrtKey.java java/security/interfaces/RSAPrivateKey.java java/security/interfaces/RSAPublicKey.java java/security/spec/AlgorithmParameterSpec.java java/security/spec/DSAParameterSpec.java java/security/spec/DSAPrivateKeySpec.java java/security/spec/DSAPublicKeySpec.java java/security/spec/EncodedKeySpec.java java/security/spec/InvalidKeySpecException.java java/security/spec/InvalidParameterSpecException.java java/security/spec/KeySpec.java java/security/spec/PKCS8EncodedKeySpec.java java/security/spec/RSAKeyGenParameterSpec.java java/security/spec/RSAPrivateCrtKeySpec.java java/security/spec/RSAPrivateKeySpec.java java/security/spec/RSAPublicKeySpec.java java/security/spec/X509EncodedKeySpec.java java/sql/Array.java java/sql/BatchUpdateException.java java/sql/Blob.java java/sql/CallableStatement.java java/sql/Clob.java java/sql/Connection.java java/sql/DataTruncation.java java/sql/DatabaseMetaData.java java/sql/Date.java java/sql/Driver.java java/sql/DriverManager.java java/sql/DriverPropertyInfo.java java/sql/PreparedStatement.java java/sql/Ref.java java/sql/ResultSet.java java/sql/ResultSetMetaData.java java/sql/SQLData.java java/sql/SQLException.java java/sql/SQLInput.java java/sql/SQLOutput.java java/sql/SQLWarning.java java/sql/Statement.java java/sql/Struct.java java/sql/Time.java java/sql/Timestamp.java java/sql/Types.java java/text/Annotation.java java/text/AttributedCharacterIterator.java java/text/AttributedString.java java/text/AttributedStringIterator.java java/text/BreakIterator.java java/text/CharacterIterator.java java/text/ChoiceFormat.java java/text/CollationElementIterator.java java/text/CollationKey.java java/text/Collator.java java/text/DateFormat.java java/text/DateFormatSymbols.java java/text/DecimalFormat.java java/text/DecimalFormatSymbols.java java/text/FieldPosition.java java/text/Format.java java/text/MessageFormat.java java/text/NumberFormat.java java/text/ParseException.java java/text/ParsePosition.java java/text/RuleBasedCollator.java java/text/SimpleDateFormat.java java/text/StringCharacterIterator.java java/util/jar/Attributes.java java/util/jar/JarEntry.java java/util/jar/JarException.java java/util/jar/JarFile.java java/util/jar/JarInputStream.java java/util/jar/JarOutputStream.java java/util/jar/Manifest.java java/util/zip/Adler32.java java/util/zip/CRC32.java java/util/zip/CheckedInputStream.java java/util/zip/CheckedOutputStream.java java/util/zip/Checksum.java java/util/zip/DataFormatException.java java/util/zip/Deflater.java java/util/zip/DeflaterOutputStream.java java/util/zip/GZIPInputStream.java java/util/zip/GZIPOutputStream.java java/util/zip/Inflater.java java/util/zip/InflaterInputStream.java java/util/zip/ZipConstants.java java/util/zip/ZipEntry.java java/util/zip/ZipException.java java/util/zip/ZipFile.java java/util/zip/ZipInputStream.java java/util/zip/ZipOutputStream.java org/w3c/dom/Attr.java org/w3c/dom/CDATASection.java org/w3c/dom/CharacterData.java org/w3c/dom/Comment.java org/w3c/dom/DOMException.java org/w3c/dom/DOMImplementation.java org/w3c/dom/Document.java org/w3c/dom/DocumentFragment.java org/w3c/dom/DocumentType.java org/w3c/dom/Element.java org/w3c/dom/Entity.java org/w3c/dom/EntityReference.java org/w3c/dom/NamedNodeMap.java org/w3c/dom/Node.java org/w3c/dom/NodeList.java org/w3c/dom/Notation.java org/w3c/dom/ProcessingInstruction.java org/w3c/dom/Text.java org/w3c/dom/ranges/DocumentRange.java org/w3c/dom/ranges/Range.java org/w3c/dom/ranges/RangeException.java org/w3c/dom/traversal/DocumentTraversal.java org/w3c/dom/traversal/NodeFilter.java org/w3c/dom/traversal/NodeIterator.java org/w3c/dom/traversal/TreeWalker.java org/xml/sax/ext/DeclHandler.java org/xml/sax/ext/LexicalHandler.java org/xml/sax/helpers/AttributeListImpl.java org/xml/sax/helpers/AttributesImpl.java org/xml/sax/helpers/DefaultHandler.java org/xml/sax/helpers/LocatorImpl.java org/xml/sax/helpers/NamespaceSupport.java org/xml/sax/helpers/ParserAdapter.java org/xml/sax/helpers/ParserFactory.java org/xml/sax/helpers/XMLFilterImpl.java org/xml/sax/helpers/XMLReaderAdapter.java org/xml/sax/helpers/XMLReaderFactory.java org/xml/sax/AttributeList.java org/xml/sax/Attributes.java org/xml/sax/ContentHandler.java org/xml/sax/DTDHandler.java org/xml/sax/DocumentHandler.java org/xml/sax/EntityResolver.java org/xml/sax/ErrorHandler.java org/xml/sax/HandlerBase.java org/xml/sax/InputSource.java org/xml/sax/Locator.java org/xml/sax/Parser.java org/xml/sax/SAXException.java org/xml/sax/SAXNotRecognizedException.java org/xml/sax/SAXNotSupportedException.java org/xml/sax/SAXParseException.java org/xml/sax/XMLFilter.java org/xml/sax/XMLReader.java $(rmi_java_source_files) $(awt_java_source_files) $(convert_source_files)
java_source_files = $(special_java_source_files) $(ordinary_java_source_files)
-c_source_files = \
- java/lang/dtoa.c java/lang/k_rem_pio2.c java/lang/s_tan.c \
- java/lang/e_acos.c java/lang/k_sin.c java/lang/strtod.c \
- java/lang/e_asin.c java/lang/k_tan.c java/lang/w_acos.c \
- java/lang/e_atan2.c java/lang/mprec.c java/lang/w_asin.c \
- java/lang/e_exp.c java/lang/s_atan.c java/lang/w_atan2.c \
- java/lang/e_fmod.c java/lang/s_ceil.c java/lang/w_exp.c \
- java/lang/e_log.c java/lang/s_copysign.c java/lang/w_fmod.c \
- java/lang/e_pow.c java/lang/s_cos.c java/lang/w_log.c \
- java/lang/e_rem_pio2.c java/lang/s_fabs.c java/lang/w_pow.c \
- java/lang/e_remainder.c java/lang/s_floor.c java/lang/w_remainder.c \
- java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c \
- java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c \
- java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c
+c_source_files = java/lang/dtoa.c java/lang/k_rem_pio2.c java/lang/s_tan.c java/lang/e_acos.c java/lang/k_sin.c java/lang/strtod.c java/lang/e_asin.c java/lang/k_tan.c java/lang/w_acos.c java/lang/e_atan2.c java/lang/mprec.c java/lang/w_asin.c java/lang/e_exp.c java/lang/s_atan.c java/lang/w_atan2.c java/lang/e_fmod.c java/lang/s_ceil.c java/lang/w_exp.c java/lang/e_log.c java/lang/s_copysign.c java/lang/w_fmod.c java/lang/e_pow.c java/lang/s_cos.c java/lang/w_log.c java/lang/e_rem_pio2.c java/lang/s_fabs.c java/lang/w_pow.c java/lang/e_remainder.c java/lang/s_floor.c java/lang/w_remainder.c java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c
#java/awt/natToolkit.cc
-nat_source_files = \
-gnu/gcj/natCore.cc \
-gnu/gcj/convert/JIS0208_to_Unicode.cc \
-gnu/gcj/convert/JIS0212_to_Unicode.cc \
-gnu/gcj/convert/Unicode_to_JIS.cc \
-gnu/gcj/convert/natIconv.cc \
-gnu/gcj/convert/natInput_EUCJIS.cc \
-gnu/gcj/convert/natInput_SJIS.cc \
-gnu/gcj/convert/natOutput_EUCJIS.cc \
-gnu/gcj/convert/natOutput_SJIS.cc \
-gnu/gcj/io/natSimpleSHSStream.cc \
-gnu/gcj/io/shs.cc \
-gnu/gcj/protocol/core/natCoreInputStream.cc \
-gnu/gcj/runtime/natFinalizerThread.cc \
-gnu/gcj/runtime/natFirstThread.cc \
-gnu/gcj/runtime/natSharedLibLoader.cc \
-java/io/natFile.cc \
-java/io/natFileDescriptor.cc \
-java/io/natObjectInputStream.cc \
-java/io/natObjectOutputStream.cc \
-java/lang/natCharacter.cc \
-java/lang/natClass.cc \
-java/lang/natClassLoader.cc \
-java/lang/natConcreteProcess.cc \
-java/lang/natDouble.cc \
-java/lang/natFloat.cc \
-java/lang/natMath.cc \
-java/lang/natObject.cc \
-java/lang/natRuntime.cc \
-java/lang/natString.cc \
-java/lang/natStringBuffer.cc \
-java/lang/natSystem.cc \
-java/lang/natThread.cc \
-java/lang/natThrowable.cc \
-java/lang/ref/natReference.cc \
-java/lang/reflect/natArray.cc \
-java/lang/reflect/natConstructor.cc \
-java/lang/reflect/natField.cc \
-java/lang/reflect/natMethod.cc \
-java/net/natInetAddress.cc \
-java/net/natPlainDatagramSocketImpl.cc \
-java/net/natPlainSocketImpl.cc \
-java/text/natCollator.cc \
-java/util/natResourceBundle.cc \
-java/util/zip/natDeflater.cc \
-java/util/zip/natInflater.cc
-
-
-x_java_source_files = \
-gnu/gcj/xlib/Clip.java \
-gnu/gcj/xlib/Colormap.java \
-gnu/gcj/xlib/Display.java \
-gnu/gcj/xlib/Drawable.java \
-gnu/gcj/xlib/Font.java \
-gnu/gcj/xlib/GC.java \
-gnu/gcj/xlib/Pixmap.java \
-gnu/gcj/xlib/Screen.java \
-gnu/gcj/xlib/Visual.java \
-gnu/gcj/xlib/WMSizeHints.java \
-gnu/gcj/xlib/Window.java \
-gnu/gcj/xlib/WindowAttributes.java \
-gnu/gcj/xlib/XAnyEvent.java \
-gnu/gcj/xlib/XButtonEvent.java \
-gnu/gcj/xlib/XColor.java \
-gnu/gcj/xlib/XConfigureEvent.java \
-gnu/gcj/xlib/XConnectException.java \
-gnu/gcj/xlib/XEvent.java \
-gnu/gcj/xlib/XException.java \
-gnu/gcj/xlib/XExposeEvent.java \
-gnu/gcj/xlib/XID.java \
-gnu/gcj/xlib/XImage.java \
-gnu/gcj/xlib/XUnmapEvent.java \
-gnu/awt/xlib/XCanvasPeer.java \
-gnu/awt/xlib/XEventLoop.java \
-gnu/awt/xlib/XEventQueue.java \
-gnu/awt/xlib/XFontMetrics.java \
-gnu/awt/xlib/XFramePeer.java \
-gnu/awt/xlib/XGraphics.java \
-gnu/awt/xlib/XGraphicsConfiguration.java \
-gnu/awt/xlib/XPanelPeer.java \
-gnu/awt/xlib/XToolkit.java
-
-
-x_nat_source_files = \
-gnu/gcj/xlib/natClip.cc \
-gnu/gcj/xlib/natColormap.cc \
-gnu/gcj/xlib/natDisplay.cc \
-gnu/gcj/xlib/natDrawable.cc \
-gnu/gcj/xlib/natFont.cc \
-gnu/gcj/xlib/natGC.cc \
-gnu/gcj/xlib/natPixmap.cc \
-gnu/gcj/xlib/natScreen.cc \
-gnu/gcj/xlib/natVisual.cc \
-gnu/gcj/xlib/natWMSizeHints.cc \
-gnu/gcj/xlib/natWindow.cc \
-gnu/gcj/xlib/natWindowAttributes.cc \
-gnu/gcj/xlib/natXAnyEvent.cc \
-gnu/gcj/xlib/natXButtonEvent.cc \
-gnu/gcj/xlib/natXColor.cc \
-gnu/gcj/xlib/natXConfigureEvent.cc \
-gnu/gcj/xlib/natXException.cc \
-gnu/gcj/xlib/natXExposeEvent.cc \
-gnu/gcj/xlib/natXImage.cc \
-gnu/gcj/xlib/natXUnmapEvent.cc
+nat_source_files = gnu/gcj/natCore.cc gnu/gcj/convert/JIS0208_to_Unicode.cc gnu/gcj/convert/JIS0212_to_Unicode.cc gnu/gcj/convert/Unicode_to_JIS.cc gnu/gcj/convert/natIconv.cc gnu/gcj/convert/natInput_EUCJIS.cc gnu/gcj/convert/natInput_SJIS.cc gnu/gcj/convert/natOutput_EUCJIS.cc gnu/gcj/convert/natOutput_SJIS.cc gnu/gcj/io/natSimpleSHSStream.cc gnu/gcj/io/shs.cc gnu/gcj/protocol/core/natCoreInputStream.cc gnu/gcj/runtime/natFinalizerThread.cc gnu/gcj/runtime/natFirstThread.cc gnu/gcj/runtime/natSharedLibLoader.cc java/io/natFile.cc java/io/natFileDescriptor.cc java/io/natObjectInputStream.cc java/io/natObjectOutputStream.cc java/lang/natCharacter.cc java/lang/natClass.cc java/lang/natClassLoader.cc java/lang/natConcreteProcess.cc java/lang/natDouble.cc java/lang/natFloat.cc java/lang/natMath.cc java/lang/natObject.cc java/lang/natRuntime.cc java/lang/natString.cc java/lang/natStringBuffer.cc java/lang/natSystem.cc java/lang/natThread.cc java/lang/natThrowable.cc java/lang/ref/natReference.cc java/lang/reflect/natArray.cc java/lang/reflect/natConstructor.cc java/lang/reflect/natField.cc java/lang/reflect/natMethod.cc java/net/natInetAddress.cc java/net/natPlainDatagramSocketImpl.cc java/net/natPlainSocketImpl.cc java/text/natCollator.cc java/util/natResourceBundle.cc java/util/zip/natDeflater.cc java/util/zip/natInflater.cc
+
+
+x_java_source_files = gnu/gcj/xlib/Clip.java gnu/gcj/xlib/Colormap.java gnu/gcj/xlib/Display.java gnu/gcj/xlib/Drawable.java gnu/gcj/xlib/Font.java gnu/gcj/xlib/GC.java gnu/gcj/xlib/Pixmap.java gnu/gcj/xlib/Screen.java gnu/gcj/xlib/Visual.java gnu/gcj/xlib/WMSizeHints.java gnu/gcj/xlib/Window.java gnu/gcj/xlib/WindowAttributes.java gnu/gcj/xlib/XAnyEvent.java gnu/gcj/xlib/XButtonEvent.java gnu/gcj/xlib/XColor.java gnu/gcj/xlib/XConfigureEvent.java gnu/gcj/xlib/XConnectException.java gnu/gcj/xlib/XEvent.java gnu/gcj/xlib/XException.java gnu/gcj/xlib/XExposeEvent.java gnu/gcj/xlib/XID.java gnu/gcj/xlib/XImage.java gnu/gcj/xlib/XUnmapEvent.java gnu/awt/xlib/XCanvasPeer.java gnu/awt/xlib/XEventLoop.java gnu/awt/xlib/XEventQueue.java gnu/awt/xlib/XFontMetrics.java gnu/awt/xlib/XFramePeer.java gnu/awt/xlib/XGraphics.java gnu/awt/xlib/XGraphicsConfiguration.java gnu/awt/xlib/XPanelPeer.java gnu/awt/xlib/XToolkit.java
+
+
+x_nat_source_files = gnu/gcj/xlib/natClip.cc gnu/gcj/xlib/natColormap.cc gnu/gcj/xlib/natDisplay.cc gnu/gcj/xlib/natDrawable.cc gnu/gcj/xlib/natFont.cc gnu/gcj/xlib/natGC.cc gnu/gcj/xlib/natPixmap.cc gnu/gcj/xlib/natScreen.cc gnu/gcj/xlib/natVisual.cc gnu/gcj/xlib/natWMSizeHints.cc gnu/gcj/xlib/natWindow.cc gnu/gcj/xlib/natWindowAttributes.cc gnu/gcj/xlib/natXAnyEvent.cc gnu/gcj/xlib/natXButtonEvent.cc gnu/gcj/xlib/natXColor.cc gnu/gcj/xlib/natXConfigureEvent.cc gnu/gcj/xlib/natXException.cc gnu/gcj/xlib/natXExposeEvent.cc gnu/gcj/xlib/natXImage.cc gnu/gcj/xlib/natXUnmapEvent.cc
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CFLAGS=$(CFLAGS)" \
- "CXXFLAGS=$(CXXFLAGS)" \
- "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
- "JC1FLAGS=$(JC1FLAGS)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
- "MAKE=$(MAKE)" \
- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
- "PICFLAG=$(PICFLAG)" \
- "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
- "SHELL=$(SHELL)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
- "exec_prefix=$(exec_prefix)" \
- "infodir=$(infodir)" \
- "libdir=$(libdir)" \
- "prefix=$(prefix)" \
- "AR=$(AR)" \
- "AS=$(AS)" \
- "CC=$(CC)" \
- "CXX=$(CXX)" \
- "LD=$(LD)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "NM=$(NM)" \
- "PICFLAG=$(PICFLAG)" \
- "RANLIB=$(RANLIB)" \
- "DESTDIR=$(DESTDIR)"
+AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "JC1FLAGS=$(JC1FLAGS)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "prefix=$(prefix)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "NM=$(NM)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "DESTDIR=$(DESTDIR)"
CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
@@ -1465,7 +391,7 @@ libgcj-test.spec.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
@@ -2102,24 +1028,25 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/util/GregorianCalendar.P .deps/java/util/HashMap.P \
.deps/java/util/HashSet.P .deps/java/util/Hashtable.P \
.deps/java/util/IdentityHashMap.P .deps/java/util/Iterator.P \
-.deps/java/util/LinkedList.P .deps/java/util/List.P \
-.deps/java/util/ListIterator.P .deps/java/util/ListResourceBundle.P \
-.deps/java/util/Locale.P .deps/java/util/Map.P \
-.deps/java/util/MissingResourceException.P \
+.deps/java/util/LinkedHashMap.P .deps/java/util/LinkedList.P \
+.deps/java/util/List.P .deps/java/util/ListIterator.P \
+.deps/java/util/ListResourceBundle.P .deps/java/util/Locale.P \
+.deps/java/util/Map.P .deps/java/util/MissingResourceException.P \
.deps/java/util/NoSuchElementException.P .deps/java/util/Observable.P \
.deps/java/util/Observer.P .deps/java/util/Properties.P \
.deps/java/util/PropertyPermission.P \
.deps/java/util/PropertyResourceBundle.P .deps/java/util/Random.P \
-.deps/java/util/ResourceBundle.P .deps/java/util/Set.P \
-.deps/java/util/SimpleTimeZone.P .deps/java/util/SortedMap.P \
-.deps/java/util/SortedSet.P .deps/java/util/Stack.P \
-.deps/java/util/StringTokenizer.P .deps/java/util/TimeZone.P \
-.deps/java/util/Timer.P .deps/java/util/TimerTask.P \
-.deps/java/util/TooManyListenersException.P .deps/java/util/TreeMap.P \
-.deps/java/util/TreeSet.P .deps/java/util/Vector.P \
-.deps/java/util/WeakHashMap.P .deps/java/util/jar/Attributes.P \
-.deps/java/util/jar/JarEntry.P .deps/java/util/jar/JarException.P \
-.deps/java/util/jar/JarFile.P .deps/java/util/jar/JarInputStream.P \
+.deps/java/util/RandomAccess.P .deps/java/util/ResourceBundle.P \
+.deps/java/util/Set.P .deps/java/util/SimpleTimeZone.P \
+.deps/java/util/SortedMap.P .deps/java/util/SortedSet.P \
+.deps/java/util/Stack.P .deps/java/util/StringTokenizer.P \
+.deps/java/util/TimeZone.P .deps/java/util/Timer.P \
+.deps/java/util/TimerTask.P .deps/java/util/TooManyListenersException.P \
+.deps/java/util/TreeMap.P .deps/java/util/TreeSet.P \
+.deps/java/util/Vector.P .deps/java/util/WeakHashMap.P \
+.deps/java/util/jar/Attributes.P .deps/java/util/jar/JarEntry.P \
+.deps/java/util/jar/JarException.P .deps/java/util/jar/JarFile.P \
+.deps/java/util/jar/JarInputStream.P \
.deps/java/util/jar/JarOutputStream.P .deps/java/util/jar/Manifest.P \
.deps/java/util/natResourceBundle.P .deps/java/util/zip/Adler32.P \
.deps/java/util/zip/CRC32.P .deps/java/util/zip/CheckedInputStream.P \
@@ -2514,7 +1441,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$/$$file $(distdir)/$$file; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
diff --git a/libjava/java/util/Collection.java b/libjava/java/util/Collection.java
index b7dbb69b1f7..11baa30f919 100644
--- a/libjava/java/util/Collection.java
+++ b/libjava/java/util/Collection.java
@@ -1,5 +1,5 @@
/* Collection.java -- Interface that represents a collection of objects
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -25,9 +25,6 @@ This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-// TO DO:
-// ~ Maybe some more @see clauses would be helpful.
-
package java.util;
/**
@@ -57,9 +54,23 @@ package java.util;
* and returns a collection containing the same elements (that is, creates a
* copy of the argument using its own implementation).
*
- * @see java.util.List
- * @see java.util.Set
- * @see java.util.AbstractCollection
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see List
+ * @see Set
+ * @see Map
+ * @see SortedSet
+ * @see SortedMap
+ * @see HashSet
+ * @see TreeSet
+ * @see ArrayList
+ * @see LinkedList
+ * @see Vector
+ * @see Collections
+ * @see Arrays
+ * @see AbstractCollection
+ * @since 1.2
+ * @status updated to 1.4
*/
public interface Collection
{
@@ -67,12 +78,12 @@ public interface Collection
* Add an element to this collection.
*
* @param o the object to add.
- * @returns true if the collection was modified as a result of this action.
- * @exception UnsupportedOperationException if this collection does not
+ * @return true if the collection was modified as a result of this action.
+ * @throws UnsupportedOperationException if this collection does not
* support the add operation.
- * @exception ClassCastException if o cannot be added to this collection due
+ * @throws ClassCastException if o cannot be added to this collection due
* to its type.
- * @exception IllegalArgumentException if o cannot be added to this
+ * @throws IllegalArgumentException if o cannot be added to this
* collection for some other reason.
*/
boolean add(Object o);
@@ -81,12 +92,12 @@ public interface Collection
* Add the contents of a given collection to this collection.
*
* @param c the collection to add.
- * @returns true if the collection was modified as a result of this action.
- * @exception UnsupportedOperationException if this collection does not
+ * @return true if the collection was modified as a result of this action.
+ * @throws UnsupportedOperationException if this collection does not
* support the addAll operation.
- * @exception ClassCastException if some element of c cannot be added to this
+ * @throws ClassCastException if some element of c cannot be added to this
* collection due to its type.
- * @exception IllegalArgumentException if some element of c cannot be added
+ * @throws IllegalArgumentException if some element of c cannot be added
* to this collection for some other reason.
*/
boolean addAll(Collection c);
@@ -95,7 +106,7 @@ public interface Collection
* Clear the collection, such that a subsequent call to isEmpty() would
* return true.
*
- * @exception UnsupportedOperationException if this collection does not
+ * @throws UnsupportedOperationException if this collection does not
* support the clear operation.
*/
void clear();
@@ -105,7 +116,7 @@ public interface Collection
* elements.
*
* @param o the element to look for.
- * @returns true if this collection contains at least one element e such that
+ * @return true if this collection contains at least one element e such that
* <code>o == null ? e == null : o.equals(e)</code>.
*/
boolean contains(Object o);
@@ -114,7 +125,7 @@ public interface Collection
* Test whether this collection contains every element in a given collection.
*
* @param c the collection to test for.
- * @returns true if for every element o in c, contains(o) would return true.
+ * @return true if for every element o in c, contains(o) would return true.
*/
boolean containsAll(Collection c);
@@ -132,7 +143,7 @@ public interface Collection
* preserve the symmetry of the relation.
*
* @param o the object to compare to this collection.
- * @returns true if the o is equal to this collection.
+ * @return true if the o is equal to this collection.
*/
boolean equals(Object o);
@@ -148,21 +159,21 @@ public interface Collection
* method renders it impossible to correctly implement both Set and List, as
* the required implementations are mutually exclusive.
*
- * @returns a hash code for this collection.
+ * @return a hash code for this collection.
*/
int hashCode();
/**
* Test whether this collection is empty, that is, if size() == 0.
*
- * @returns true if this collection contains no elements.
+ * @return true if this collection contains no elements.
*/
boolean isEmpty();
/**
* Obtain an Iterator over this collection.
*
- * @returns an Iterator over the elements of this collection, in any order.
+ * @return an Iterator over the elements of this collection, in any order.
*/
Iterator iterator();
@@ -172,9 +183,9 @@ public interface Collection
* : o.equals(e)</code>.
*
* @param o the object to remove.
- * @returns true if the collection changed as a result of this call, that is,
+ * @return true if the collection changed as a result of this call, that is,
* if the collection contained at least one occurrence of o.
- * @exception UnsupportedOperationException if this collection does not
+ * @throws UnsupportedOperationException if this collection does not
* support the remove operation.
*/
boolean remove(Object o);
@@ -183,8 +194,8 @@ public interface Collection
* Remove all elements of a given collection from this collection. That is,
* remove every element e such that c.contains(e).
*
- * @returns true if this collection was modified as a result of this call.
- * @exception UnsupportedOperationException if this collection does not
+ * @return true if this collection was modified as a result of this call.
+ * @throws UnsupportedOperationException if this collection does not
* support the removeAll operation.
*/
boolean removeAll(Collection c);
@@ -193,8 +204,8 @@ public interface Collection
* Remove all elements of this collection that are not contained in a given
* collection. That is, remove every element e such that !c.contains(e).
*
- * @returns true if this collection was modified as a result of this call.
- * @exception UnsupportedOperationException if this collection does not
+ * @return true if this collection was modified as a result of this call.
+ * @throws UnsupportedOperationException if this collection does not
* support the retainAll operation.
*/
boolean retainAll(Collection c);
@@ -202,14 +213,14 @@ public interface Collection
/**
* Get the number of elements in this collection.
*
- * @returns the number of elements in the collection.
+ * @return the number of elements in the collection.
*/
int size();
/**
* Copy the current contents of this collection into an array.
*
- * @returns an array of type Object[] and length equal to the size of this
+ * @return an array of type Object[] and length equal to the size of this
* collection, containing the elements currently in this collection, in
* any order.
*/
@@ -227,9 +238,9 @@ public interface Collection
* if it is known that this collection does not contain any null elements.
*
* @param a the array to copy this collection into.
- * @returns an array containing the elements currently in this collection, in
+ * @return an array containing the elements currently in this collection, in
* any order.
- * @exception ArrayStoreException if the type of any element of the
+ * @throws ArrayStoreException if the type of any element of the
* collection is not a subtype of the element type of a.
*/
Object[] toArray(Object[] a);
diff --git a/libjava/java/util/Comparator.java b/libjava/java/util/Comparator.java
index fc61fc30280..8522301eedf 100644
--- a/libjava/java/util/Comparator.java
+++ b/libjava/java/util/Comparator.java
@@ -29,36 +29,67 @@ package java.util;
/**
* Interface for objects that specify an ordering between objects. The ordering
- * can be <EM>total</EM>, such that two objects only compare equal if they are
- * equal by the equals method, or <EM>partial</EM> such that this is not
- * necessarily true. For example, a case-sensitive dictionary order comparison
- * of Strings is total, but if it is case-insensitive it is partial, because
- * "abc" and "ABC" compare as equal even though "abc".equals("ABC") returns
- * false.
+ * should be <em>total</em>, such that any two objects of the correct type
+ * can be compared, and the comparison is reflexive, anti-symmetric, and
+ * transitive. It is also recommended that the comparator be <em>consistent
+ * with equals</em>, although this is not a strict requirement. A relation
+ * is consistent with equals if these two statements always have the same
+ * results (if no exceptions occur):<br>
+ * <code>compare((Object) e1, (Object) e2) == 0</code> and
+ * <code>e1.equals((Object) e2)</code><br>
+ * Comparators that violate consistency with equals may cause strange behavior
+ * in sorted lists and sets. For example, a case-sensitive dictionary order
+ * comparison of Strings is consistent with equals, but if it is
+ * case-insensitive it is not, because "abc" and "ABC" compare as equal even
+ * though "abc".equals("ABC") returns false.
* <P>
* In general, Comparators should be Serializable, because when they are passed
* to Serializable data structures such as SortedMap or SortedSet, the entire
* data structure will only serialize correctly if the comparator is
* Serializable.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Comparable
+ * @see TreeMap
+ * @see TreeSet
+ * @see SortedMap
+ * @see SortedSet
+ * @see Arrays#sort(Object[], Comparator)
+ * @see java.io.Serializable
+ * @since 1.2
+ * @status updated to 1.4
*/
public interface Comparator
{
/**
* Return an integer that is negative, zero or positive depending on whether
* the first argument is less than, equal to or greater than the second
- * according to this ordering. This method should obey the following contract:
- * <UL>
- * <LI>if compare(a, b) &lt; 0 then compare(b, a) &gt; 0</LI>
- * <LI>if compare(a, b) throws an exception, so does compare(b, a)</LI>
- * <LI>if compare(a, b) &lt; 0 and compare(b, c) &lt; 0 then compare(a, c)
- * &lt; 0</LI>
- * <LI>if a.equals(b) or both a and b are null, then compare(a, b) == 0.
- * The converse need not be true, but if it is, this Comparator
- * specifies a <EM>total</EM> ordering.</LI>
- * </UL>
+ * according to this ordering. This method should obey the following
+ * contract:
+ * <ul>
+ * <li>if compare(a, b) &lt; 0 then compare(b, a) &gt; 0</li>
+ * <li>if compare(a, b) throws an exception, so does compare(b, a)</li>
+ * <li>if compare(a, b) &lt; 0 and compare(b, c) &lt; 0 then compare(a, c)
+ * &lt; 0</li>
+ * <li>if compare(a, b) == 0 then compare(a, c) and compare(b, c) must
+ * have the same sign</li
+ * </ul>
+ * To be consistent with equals, the following additional constraint is
+ * in place:
+ * <ul>
+ * <li>if a.equals(b) or both a and b are null, then
+ * compare(a, b) == 0.</li>
+ * </ul><p>
*
+ * Although it is permissible for a comparator to provide an order
+ * inconsistent with equals, that should be documented.
+ *
+ * @param o1 the first object
+ * @param o2 the second object
+ * @return the comparison
* @throws ClassCastException if the elements are not of types that can be
- * compared by this ordering.
+ * compared by this ordering.
*/
int compare(Object o1, Object o2);
@@ -66,8 +97,12 @@ public interface Comparator
* Return true if the object is equal to this object. To be
* considered equal, the argument object must satisfy the constraints
* of <code>Object.equals()</code>, be a Comparator, and impose the
- * same ordering as this Comparator.
+ * same ordering as this Comparator. The default implementation
+ * inherited from Object is usually adequate.
+ *
* @param obj The object
+ * @return true if it is a Comparator that imposes the same order
+ * @see Object#equals(Object)
*/
boolean equals(Object obj);
}
diff --git a/libjava/java/util/Enumeration.java b/libjava/java/util/Enumeration.java
index 66624bd3ab6..5bcfbee3b71 100644
--- a/libjava/java/util/Enumeration.java
+++ b/libjava/java/util/Enumeration.java
@@ -42,7 +42,12 @@ package java.util;
* be obtained by the enumeration method in class Collections.
*
* @author Warren Levy <warrenl@cygnus.com>
- * @date August 25, 1998.
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Iterator
+ * @see Hashtable
+ * @see Vector
+ * @since 1.0
+ * @status updated to 1.4
*/
public interface Enumeration
{
@@ -50,8 +55,8 @@ public interface Enumeration
* Tests whether there are elements remaining in the enumeration.
*
* @return true if there is at least one more element in the enumeration,
- * that is, if the next call to nextElement will not throw a
- * NoSuchElementException.
+ * that is, if the next call to nextElement will not throw a
+ * NoSuchElementException.
*/
boolean hasMoreElements();
@@ -59,7 +64,7 @@ public interface Enumeration
* Obtain the next element in the enumeration.
*
* @return the next element in the enumeration
- * @exception NoSuchElementException if there are no more elements
+ * @throws NoSuchElementException if there are no more elements
*/
- Object nextElement() throws NoSuchElementException;
+ Object nextElement();
}
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
index 4bc88b75570..b75718ffa63 100644
--- a/libjava/java/util/HashMap.java
+++ b/libjava/java/util/HashMap.java
@@ -1,6 +1,6 @@
/* HashMap.java -- a class providing a basic hashtable data structure,
mapping Object --> Object
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,83 +37,137 @@ import java.io.ObjectOutputStream;
// a bug in here, chances are you should make a similar change to the Hashtable
// code.
+// NOTE: This implementation has some nasty coding style in order to
+// support LinkedHashMap, which extends this.
+
/**
* This class provides a hashtable-backed implementation of the
- * Map interface.
+ * Map interface.
+ * <p>
*
- * It uses a hash-bucket approach; that is, hash
- * collisions are handled by linking the new node off of the
- * pre-existing node (or list of nodes). In this manner, techniques
- * such as linear probing (which can casue primary clustering) and
- * rehashing (which does not fit very well with Java's method of
- * precomputing hash codes) are avoided.
+ * It uses a hash-bucket approach; that is, hash collisions are handled
+ * by linking the new node off of the pre-existing node (or list of
+ * nodes). In this manner, techniques such as linear probing (which
+ * can cause primary clustering) and rehashing (which does not fit very
+ * well with Java's method of precomputing hash codes) are avoided.
+ * <p>
*
- * Under ideal circumstances (no collisions, HashMap offers O(1)
+ * Under ideal circumstances (no collisions), HashMap offers O(1)
* performance on most operations (<pre>containsValue()</pre> is,
- * of course, O(n)). In the worst case (all keys map to the same
+ * of course, O(n)). In the worst case (all keys map to the same
* hash code -- very unlikely), most operations are O(n).
+ * <p>
*
- * HashMap is part of the JDK1.2 Collections API. It differs from
+ * HashMap is part of the JDK1.2 Collections API. It differs from
* Hashtable in that it accepts the null key and null values, and it
* does not support "Enumeration views."
+ * <p>
+ *
+ * The iterators are <i>fail-fast</i>, meaning that any structural
+ * modification, except for <code>remove()</code> called on the iterator
+ * itself, cause the iterator to throw a
+ * <code>ConcurrentModificationException</code> rather than exhibit
+ * non-deterministic behavior.
*
- * @author Jon Zeppieri
- * @author Jochen Hoenicke
- * @author Bryce McKinlay
+ * @author Jon Zeppieri
+ * @author Jochen Hoenicke
+ * @author Bryce McKinlay
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Object#hashCode()
+ * @see Collection
+ * @see Map
+ * @see TreeMap
+ * @see LinkedHashMap
+ * @see IdentityHashMap
+ * @see Hashtable
+ * @since 1.2
*/
public class HashMap extends AbstractMap
implements Map, Cloneable, Serializable
{
- /** Default number of buckets. This is the value the JDK 1.3 uses. Some
- * early documentation specified this value as 101. That is incorrect. */
- private static final int DEFAULT_CAPACITY = 11;
- /** The defaulty load factor; this is explicitly specified by the spec. */
- private static final float DEFAULT_LOAD_FACTOR = 0.75f;
+ /**
+ * Default number of buckets. This is the value the JDK 1.3 uses. Some
+ * early documentation specified this value as 101. That is incorrect.
+ */
+ static final int DEFAULT_CAPACITY = 11;
+
+ /**
+ * The default load factor; this is explicitly specified by the spec.
+ */
+ static final float DEFAULT_LOAD_FACTOR = 0.75f;
+
+ /** "enum" of iterator types. */
+ static final int KEYS = 0,
+ VALUES = 1,
+ ENTRIES = 2;
+ /**
+ * Compatible with JDK 1.2.
+ */
private static final long serialVersionUID = 362498820763181265L;
- /**
- * The rounded product of the capacity and the load factor; when the number
+ /**
+ * The rounded product of the capacity and the load factor; when the number
* of elements exceeds the threshold, the HashMap calls <pre>rehash()</pre>.
* @serial
*/
int threshold;
- /** Load factor of this HashMap: used in computing the threshold.
+ /**
+ * Load factor of this HashMap: used in computing the threshold.
* @serial
*/
- float loadFactor = DEFAULT_LOAD_FACTOR;
+ final float loadFactor;
- /**
- * Array containing the actual key-value mappings
+ /**
+ * Array containing the actual key-value mappings.
*/
- transient Entry[] buckets;
+ transient HashEntry[] buckets;
- /**
- * counts the number of modifications this HashMap has undergone, used
+ /**
+ * Counts the number of modifications this HashMap has undergone, used
* by Iterators to know when to throw ConcurrentModificationExceptions.
*/
transient int modCount;
- /** the size of this HashMap: denotes the number of key-value pairs */
+ /**
+ * The size of this HashMap: denotes the number of key-value pairs.
+ */
transient int size;
/**
* Class to represent an entry in the hash table. Holds a single key-value
- * pair.
+ * pair. This is extended again in LinkedHashMap. See {@link clone()}
+ * for why this must be Cloneable.
*/
- static class Entry extends BasicMapEntry
+ static class HashEntry extends BasicMapEntry implements Cloneable
{
- Entry next;
-
- Entry(Object key, Object value)
+ /** The next entry in the linked list. */
+ HashEntry next;
+
+ /**
+ * Simple constructor.
+ * @param key the key
+ * @param value the value
+ */
+ HashEntry(Object key, Object value)
{
super(key, value);
}
+
+ /**
+ * Called when this entry is removed from the map. This version simply
+ * returns the value, but in LinkedHashMap, it must also do bookkeeping.
+ * @return the value of this key as it is removed.
+ */
+ Object cleanup()
+ {
+ return value;
+ }
}
/**
- * construct a new HashMap with the default capacity (11) and the default
+ * Construct a new HashMap with the default capacity (11) and the default
* load factor (0.75).
*/
public HashMap()
@@ -122,237 +176,279 @@ public class HashMap extends AbstractMap
}
/**
- * construct a new HashMap from the given Map
- *
- * every element in Map t will be put into this new HashMap
+ * Construct a new HashMap from the given Map, with initial capacity
+ * the greater of the size of <code>m</code> or the default of 11.
+ * <p>
*
- * @param t a Map whose key / value pairs will be put into
- * the new HashMap. <b>NOTE: key / value pairs
- * are not cloned in this constructor</b>
+ * Every element in Map m will be put into this new HashMap.
+ *
+ * @param m a Map whose key / value pairs will be put into
+ * the new HashMap. <b>NOTE: key / value pairs
+ * are not cloned in this constructor.</b>
+ * @throws NullPointerException if m is null
*/
public HashMap(Map m)
{
- int size = Math.max(m.size() * 2, DEFAULT_CAPACITY);
- buckets = new Entry[size];
- threshold = (int) (size * loadFactor);
- putAll(m);
+ this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
+ putAllInternal(m);
}
/**
- * construct a new HashMap with a specific inital capacity
- *
- * @param initialCapacity the initial capacity of this HashMap (>=0)
+ * Construct a new HashMap with a specific inital capacity and
+ * default load factor of 0.75.
*
- * @throws IllegalArgumentException if (initialCapacity < 0)
+ * @param initialCapacity the initial capacity of this HashMap (>=0)
+ * @throws IllegalArgumentException if (initialCapacity < 0)
*/
- public HashMap(int initialCapacity) throws IllegalArgumentException
+ public HashMap(int initialCapacity)
{
this(initialCapacity, DEFAULT_LOAD_FACTOR);
}
/**
- * construct a new HashMap with a specific inital capacity and load factor
+ * Construct a new HashMap with a specific inital capacity and load factor.
*
- * @param initialCapacity the initial capacity (>=0)
- * @param loadFactor the load factor
- *
- * @throws IllegalArgumentException if (initialCapacity < 0) ||
- * (loadFactor <= 0)
+ * @param initialCapacity the initial capacity (>=0)
+ * @param loadFactor the load factor (>0, not NaN)
+ * @throws IllegalArgumentException if (initialCapacity < 0) ||
+ * ! (loadFactor > 0.0)
*/
public HashMap(int initialCapacity, float loadFactor)
- throws IllegalArgumentException
{
if (initialCapacity < 0)
- throw new IllegalArgumentException("Illegal Initial Capacity: "
- + initialCapacity);
- if (loadFactor <= 0)
- throw new IllegalArgumentException("Illegal Load Factor: " + loadFactor);
+ throw new IllegalArgumentException("Illegal Capacity: "
+ + initialCapacity);
+ if (! (loadFactor > 0)) // check for NaN too
+ throw new IllegalArgumentException("Illegal Load: " + loadFactor);
if (initialCapacity == 0)
initialCapacity = 1;
- buckets = new Entry[initialCapacity];
+ buckets = new HashEntry[initialCapacity];
this.loadFactor = loadFactor;
- this.threshold = (int) (initialCapacity * loadFactor);
+ threshold = (int) (initialCapacity * loadFactor);
}
- /** returns the number of kay-value mappings currently in this Map */
+ /**
+ * Returns the number of kay-value mappings currently in this Map
+ * @return the size
+ */
public int size()
{
return size;
}
- /** returns true if there are no key-value mappings currently in this Map */
+ /**
+ * Returns true if there are no key-value mappings currently in this Map
+ * @return <code>size() == 0</code>
+ */
public boolean isEmpty()
{
return size == 0;
}
/**
- * returns true if this HashMap contains a value <pre>o</pre>, such that
+ * Returns true if this HashMap contains a value <pre>o</pre>, such that
* <pre>o.equals(value)</pre>.
*
- * @param value the value to search for in this Hashtable
+ * @param value the value to search for in this HashMap
+ * @return true if at least one key maps to the value
*/
public boolean containsValue(Object value)
{
- for (int i = 0; i < buckets.length; i++)
+ for (int i = buckets.length - 1; i >= 0; i--)
{
- Entry e = buckets[i];
- while (e != null)
- {
- if (value == null ? e.value == null : value.equals(e.value))
- return true;
- e = e.next;
- }
+ HashEntry e = buckets[i];
+ while (e != null)
+ {
+ if (value == null ? e.value == null : value.equals(e.value))
+ return true;
+ e = e.next;
+ }
}
return false;
}
- /**
- * returns true if the supplied object equals (<pre>equals()</pre>) a key
- * in this HashMap
+ /**
+ * Returns true if the supplied object <pre>equals()</pre> a key
+ * in this HashMap.
*
- * @param key the key to search for in this HashMap
+ * @param key the key to search for in this HashMap
+ * @return true if the key is in the table
+ * @see #containsValue(Object)
*/
public boolean containsKey(Object key)
{
int idx = hash(key);
- Entry e = buckets[idx];
+ HashEntry e = buckets[idx];
while (e != null)
{
if (key == null ? e.key == null : key.equals(e.key))
- return true;
- e = e.next;
+ return true;
+ e = e.next;
}
return false;
}
/**
- * return the value in this Hashtable associated with the supplied key, or <pre>null</pre>
- * if the key maps to nothing
+ * Return the value in this HashMap associated with the supplied key,
+ * or <pre>null</pre> if the key maps to nothing. NOTE: Since the value
+ * could also be null, you must use containsKey to see if this key
+ * actually maps to something.
*
- * @param key the key for which to fetch an associated value
+ * @param key the key for which to fetch an associated value
+ * @return what the key maps to, if present
+ * @see #put(Object, Object)
+ * @see #containsKey(Object)
*/
public Object get(Object key)
{
int idx = hash(key);
- Entry e = buckets[idx];
+ HashEntry e = buckets[idx];
while (e != null)
{
if (key == null ? e.key == null : key.equals(e.key))
- return e.value;
- e = e.next;
+ return e.value;
+ e = e.next;
}
return null;
}
/**
- * puts the supplied value into the Map, mapped by the supplied key
+ * Puts the supplied value into the Map, mapped by the supplied key.
+ * The value may be retrieved by any object which <code>equals()</code>
+ * this key. NOTE: Since the prior value could also be null, you must
+ * first use containsKey if you want to see if you are replacing the
+ * key's mapping.
*
- * @param key the HashMap key used to locate the value
- * @param value the value to be stored in the HashMap
+ * @param key the key used to locate the value
+ * @param value the value to be stored in the HashMap
+ * @return the prior mapping of the key, or null if there was none
+ * @see #get(Object)
+ * @see Object#equals(Object)
*/
public Object put(Object key, Object value)
{
modCount++;
int idx = hash(key);
- Entry e = buckets[idx];
-
+ HashEntry e = buckets[idx];
+
while (e != null)
{
if (key == null ? e.key == null : key.equals(e.key))
- {
- Object r = e.value;
- e.value = value;
- return r;
- }
- else
- {
- e = e.next;
- }
+ // Must use this method for necessary bookkeeping in LinkedHashMap.
+ return e.setValue(value);
+ else
+ e = e.next;
}
-
+
// At this point, we know we need to add a new entry.
if (++size > threshold)
{
- rehash();
- // Need a new hash value to suit the bigger table.
- idx = hash(key);
+ rehash();
+ // Need a new hash value to suit the bigger table.
+ idx = hash(key);
}
- e = new Entry(key, value);
-
+ // LinkedHashMap cannot override put(), hence this call.
+ addEntry(key, value, idx, true);
+ return null;
+ }
+
+ /**
+ * Helper method for put, that creates and adds a new Entry. This is
+ * overridden in LinkedHashMap for bookkeeping purposes.
+ *
+ * @param key the key of the new Entry
+ * @param value the value
+ * @param idx the index in buckets where the new Entry belongs
+ * @param callRemove Whether to call the removeEldestEntry method.
+ * @see #put(Object, Object)
+ */
+ void addEntry(Object key, Object value, int idx, boolean callRemove)
+ {
+ HashEntry e = new HashEntry(key, value);
+
e.next = buckets[idx];
buckets[idx] = e;
-
- return null;
}
/**
- * removes from the HashMap and returns the value which is mapped by the
- * supplied key; if the key maps to nothing, then the HashMap remains unchanged,
- * and <pre>null</pre> is returned
+ * Removes from the HashMap and returns the value which is mapped by the
+ * supplied key. If the key maps to nothing, then the HashMap remains
+ * unchanged, and <pre>null</pre> is returned. NOTE: Since the value
+ * could also be null, you must use containsKey to see if you are
+ * actually removing a mapping.
*
- * @param key the key used to locate the value to remove from the HashMap
+ * @param key the key used to locate the value to remove
+ * @return whatever the key mapped to, if present
*/
public Object remove(Object key)
{
modCount++;
int idx = hash(key);
- Entry e = buckets[idx];
- Entry last = null;
+ HashEntry e = buckets[idx];
+ HashEntry last = null;
while (e != null)
{
if (key == null ? e.key == null : key.equals(e.key))
- {
- if (last == null)
- buckets[idx] = e.next;
- else
- last.next = e.next;
- size--;
- return e.value;
- }
- last = e;
- e = e.next;
+ {
+ if (last == null)
+ buckets[idx] = e.next;
+ else
+ last.next = e.next;
+ size--;
+ // Method call necessary for LinkedHashMap to work correctly.
+ return e.cleanup();
+ }
+ last = e;
+ e = e.next;
}
return null;
}
+ /**
+ * Copies all elements of the given map into this hashtable. If this table
+ * already has a mapping for a key, the new mapping replaces the current
+ * one.
+ *
+ * @param m the map to be hashed into this
+ */
public void putAll(Map m)
{
- int msize = m.size();
Iterator itr = m.entrySet().iterator();
-
- for (int i=0; i < msize; i++)
+
+ for (int msize = m.size(); msize > 0; msize--)
{
Map.Entry e = (Map.Entry) itr.next();
- // Optimize in case the Entry is one of our own.
- if (e instanceof BasicMapEntry)
- {
- BasicMapEntry entry = (BasicMapEntry) e;
- put(entry.key, entry.value);
- }
- else
- {
+ // Optimize in case the Entry is one of our own.
+ if (e instanceof BasicMapEntry)
+ {
+ BasicMapEntry entry = (BasicMapEntry) e;
+ put(entry.key, entry.value);
+ }
+ else
+ {
put(e.getKey(), e.getValue());
- }
+ }
}
}
+ /**
+ * Clears the Map so it has no keys. This is O(1).
+ */
public void clear()
{
modCount++;
- for (int i=0; i < buckets.length; i++)
- {
- buckets[i] = null;
- }
+ Arrays.fill(buckets, null);
size = 0;
}
- /**
- * returns a shallow clone of this HashMap (i.e. the Map itself is cloned, but
- * its contents are not)
+ /**
+ * Returns a shallow clone of this HashMap. The Map itself is cloned,
+ * but its contents are not. This is O(n).
+ *
+ * @return the clone
*/
public Object clone()
{
@@ -363,49 +459,39 @@ public class HashMap extends AbstractMap
}
catch (CloneNotSupportedException x)
{
+ // This is impossible.
}
- copy.buckets = new Entry[buckets.length];
-
- for (int i=0; i < buckets.length; i++)
- {
- Entry e = buckets[i];
- Entry last = null;
-
- while (e != null)
- {
- if (last == null)
- {
- copy.buckets[i] = new Entry(e.key, e.value);
- last = copy.buckets[i];
- }
- else
- {
- last.next = new Entry(e.key, e.value);
- last = last.next;
- }
- e = e.next;
- }
- }
+ copy.buckets = new HashEntry[buckets.length];
+ copy.putAllInternal(this);
return copy;
}
- /** returns a "set view" of this HashMap's keys */
+ /**
+ * Returns a "set view" of this HashMap's keys. The set is backed by the
+ * HashMap, so changes in one show up in the other. The set supports
+ * element removal, but not element addition.
+ *
+ * @return a set view of the keys
+ * @see #values()
+ * @see #entrySet()
+ */
public Set keySet()
{
- // Create an AbstractSet with custom implementations of those methods that
- // can be overriden easily and efficiently.
+ // Create an AbstractSet with custom implementations of those methods that
+ // can be overridden easily and efficiently.
return new AbstractSet()
{
public int size()
{
return size;
}
-
+
public Iterator iterator()
{
- return new HashIterator(HashIterator.KEYS);
+ // Cannot create the iterator directly, because of LinkedHashMap.
+ return HashMap.this.iterator(KEYS);
}
-
+
public void clear()
{
HashMap.this.clear();
@@ -415,20 +501,29 @@ public class HashMap extends AbstractMap
{
return HashMap.this.containsKey(o);
}
-
+
public boolean remove(Object o)
{
// Test against the size of the HashMap to determine if anything
- // really got removed. This is neccessary because the return value of
- // HashMap.remove() is ambiguous in the null case.
+ // really got removed. This is neccessary because the return value of
+ // HashMap.remove() is ambiguous in the null case.
int oldsize = size;
HashMap.this.remove(o);
- return (oldsize != size);
+ return (oldsize != size);
}
};
}
-
- /** Returns a "collection view" (or "bag view") of this HashMap's values. */
+
+ /**
+ * Returns a "collection view" (or "bag view") of this HashMap's values.
+ * The collection is backed by the HashMap, so changes in one show up
+ * in the other. The collection supports element removal, but not element
+ * addition.
+ *
+ * @return a bag view of the values
+ * @see #keySet()
+ * @see #entrySet()
+ */
public Collection values()
{
// We don't bother overriding many of the optional methods, as doing so
@@ -439,12 +534,13 @@ public class HashMap extends AbstractMap
{
return size;
}
-
+
public Iterator iterator()
{
- return new HashIterator(HashIterator.VALUES);
+ // Cannot create the iterator directly, because of LinkedHashMap.
+ return HashMap.this.iterator(VALUES);
}
-
+
public void clear()
{
HashMap.this.clear();
@@ -452,23 +548,37 @@ public class HashMap extends AbstractMap
};
}
- /** Returns a "set view" of this HashMap's entries. */
+ /**
+ * Returns a "set view" of this HashMap's entries. The set is backed by
+ * the HashMap, so changes in one show up in the other. The set supports
+ * element removal, but not element addition.
+ * <p>
+ *
+ * Note that the iterators for all three views, from keySet(), entrySet(),
+ * and values(), traverse the HashMap in the same sequence.
+ *
+ * @return a set view of the entries
+ * @see #keySet()
+ * @see #values()
+ * @see Map.Entry
+ */
public Set entrySet()
{
- // Create an AbstractSet with custom implementations of those methods that
- // can be overriden easily and efficiently.
+ // Create an AbstractSet with custom implementations of those methods that
+ // can be overridden easily and efficiently.
return new AbstractSet()
{
public int size()
{
return size;
}
-
+
public Iterator iterator()
{
- return new HashIterator(HashIterator.ENTRIES);
+ // Cannot create the iterator directly, because of LinkedHashMap.
+ return HashMap.this.iterator(ENTRIES);
}
-
+
public void clear()
{
HashMap.this.clear();
@@ -476,143 +586,184 @@ public class HashMap extends AbstractMap
public boolean contains(Object o)
{
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry me = (Map.Entry) o;
- Entry e = getEntry(me);
- return (e != null);
+ return getEntry(o) != null;
}
-
+
public boolean remove(Object o)
{
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry me = (Map.Entry) o;
- Entry e = getEntry(me);
- if (e != null)
- {
- HashMap.this.remove(e.key);
- return true;
- }
- return false;
+ HashEntry e = getEntry(o);
+ if (e != null)
+ {
+ HashMap.this.remove(e.key);
+ return true;
+ }
+ return false;
}
};
}
-
- /** Return an index in the buckets array for `key' based on its hashCode() */
- private int hash(Object key)
+
+ /** Helper method that returns an index in the buckets array for `key;
+ * based on its hashCode().
+ *
+ * @param key the key
+ * @return the bucket number
+ */
+ int hash(Object key)
{
- if (key == null)
- return 0;
- else
- return Math.abs(key.hashCode() % buckets.length);
+ return (key == null) ? 0 : Math.abs(key.hashCode() % buckets.length);
}
- /** Return an Entry who's key and value equal the supplied Map.Entry.
- * This is used by entrySet's contains() and remove() methods. They can't
- * use contains(key) and remove(key) directly because that would result
- * in entries with the same key but a different value being matched. */
- private Entry getEntry(Map.Entry me)
+ /**
+ * Helper method for entrySet(), which matches both key and value
+ * simultaneously.
+ *
+ * @param o the entry to match
+ * @return the matching entry, if found, or null
+ * @see #entrySet()
+ */
+ private HashEntry getEntry(Object o)
{
+ if (!(o instanceof Map.Entry))
+ return null;
+ Map.Entry me = (Map.Entry) o;
int idx = hash(me.getKey());
- Entry e = buckets[idx];
+ HashEntry e = buckets[idx];
while (e != null)
{
if (e.equals(me))
- return e;
- e = e.next;
+ return e;
+ e = e.next;
}
return null;
}
-
- /**
- * increases the size of the HashMap and rehashes all keys to new array
- * indices; this is called when the addition of a new value would cause
- * size() > threshold. Note that the existing Entry objects are reused in
+
+ /**
+ * Increases the size of the HashMap and rehashes all keys to new array
+ * indices; this is called when the addition of a new value would cause
+ * size() > threshold. Note that the existing Entry objects are reused in
* the new hash table.
+ * <p>
+ *
+ * This is not specified, but the new size is twice the current size plus
+ * one; this number is not always prime, unfortunately.
*/
private void rehash()
{
- Entry[] oldBuckets = buckets;
-
+ HashEntry[] oldBuckets = buckets;
+
int newcapacity = (buckets.length * 2) + 1;
threshold = (int) (newcapacity * loadFactor);
- buckets = new Entry[newcapacity];
-
- for (int i = 0; i < oldBuckets.length; i++)
+ buckets = new HashEntry[newcapacity];
+
+ for (int i = oldBuckets.length - 1; i >= 0; i--)
{
- Entry e = oldBuckets[i];
+ HashEntry e = oldBuckets[i];
while (e != null)
- {
- int idx = hash(e.key);
- Entry dest = buckets[idx];
-
- if (dest != null)
- {
- while (dest.next != null)
- dest = dest.next;
- dest.next = e;
- }
- else
- {
- buckets[idx] = e;
- }
-
- Entry next = e.next;
- e.next = null;
- e = next;
- }
+ {
+ int idx = hash(e.key);
+ HashEntry dest = buckets[idx];
+
+ if (dest != null)
+ {
+ while (dest.next != null)
+ dest = dest.next;
+ dest.next = e;
+ }
+ else
+ {
+ buckets[idx] = e;
+ }
+
+ HashEntry next = e.next;
+ e.next = null;
+ e = next;
+ }
+ }
+ }
+
+ /**
+ * Generates a parameterized iterator. Must be overrideable, since
+ * LinkedHashMap iterates in a different order.
+ * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
+ * @return the appropriate iterator
+ */
+ Iterator iterator(int type)
+ {
+ return new HashIterator(type);
+ }
+
+ /**
+ * A simplified, more efficient internal implementation of putAll(). The
+ * Map constructor and clone() should not call putAll or put, in order to
+ * be compatible with the JDK implementation with respect to subclasses.
+ */
+ void putAllInternal(Map m)
+ {
+ Iterator itr = m.entrySet().iterator();
+
+ for (int msize = m.size(); msize > 0; msize--)
+ {
+ Map.Entry e = (Map.Entry) itr.next();
+ Object key = e.getKey();
+ int idx = hash(key);
+ addEntry(key, e.getValue(), idx, false);
}
}
/**
* Serializes this object to the given stream.
- * @serialdata the <i>capacity</i>(int) that is the length of the
- * bucket array, the <i>size</i>(int) of the hash map are emitted
- * first. They are followed by size entries, each consisting of
- * a key (Object) and a value (Object).
+ *
+ * @param s the stream to write to
+ * @throws IOException if the underlying stream fails
+ * @serialData the <i>capacity</i>(int) that is the length of the
+ * bucket array, the <i>size</i>(int) of the hash map
+ * are emitted first. They are followed by size entries,
+ * each consisting of a key (Object) and a value (Object).
*/
private void writeObject(ObjectOutputStream s) throws IOException
{
- // the threshold and loadFactor fields
+ // Write the threshold and loadFactor fields.
s.defaultWriteObject();
s.writeInt(buckets.length);
s.writeInt(size);
- Iterator it = entrySet().iterator();
+ // Avoid creating a wasted Set by creating the iterator directly.
+ Iterator it = iterator(ENTRIES);
while (it.hasNext())
{
- Map.Entry entry = (Map.Entry) it.next();
- s.writeObject(entry.getKey());
- s.writeObject(entry.getValue());
+ HashEntry entry = (HashEntry) it.next();
+ s.writeObject(entry.key);
+ s.writeObject(entry.value);
}
}
/**
* Deserializes this object from the given stream.
- * @serialdata the <i>capacity</i>(int) that is the length of the
- * bucket array, the <i>size</i>(int) of the hash map are emitted
- * first. They are followed by size entries, each consisting of
- * a key (Object) and a value (Object).
+ *
+ * @param s the stream to read from
+ * @throws ClassNotFoundException if the underlying stream fails
+ * @throws IOException if the underlying stream fails
+ * @serialData the <i>capacity</i>(int) that is the length of the
+ * bucket array, the <i>size</i>(int) of the hash map
+ * are emitted first. They are followed by size entries,
+ * each consisting of a key (Object) and a value (Object).
*/
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
- // the threshold and loadFactor fields
+ // Read the threshold and loadFactor fields.
s.defaultReadObject();
- int capacity = s.readInt();
+ // Read and use capacity.
+ buckets = new HashEntry[s.readInt()];
int len = s.readInt();
- size = 0;
- modCount = 0;
- buckets = new Entry[capacity];
+ // Already happens automatically.
+ // size = 0;
+ // modCount = 0;
- for (int i = 0; i < len; i++)
- {
- Object key = s.readObject();
- Object value = s.readObject();
- put(key, value);
- }
+ // Read and use key/value pairs.
+ for ( ; len > 0; len--)
+ put(s.readObject(), s.readObject());
}
/**
@@ -620,64 +771,70 @@ public class HashMap extends AbstractMap
* This implementation is parameterized to give a sequential view of
* keys, values, or entries.
*
- * @author Jon Zeppieri
+ * @author Jon Zeppieri
*/
class HashIterator implements Iterator
{
- static final int KEYS = 0,
- VALUES = 1,
- ENTRIES = 2;
-
- // the type of this Iterator: KEYS, VALUES, or ENTRIES.
- int type;
- // the number of modifications to the backing Hashtable that we know about.
- int knownMod;
- // The total number of elements returned by next(). Used to determine if
- // there are more elements remaining.
- int count;
- // Current index in the physical hash table.
- int idx;
- // The last Entry returned by a next() call.
- Entry last;
- // The next entry that should be returned by next(). It is set to something
- // if we're iterating through a bucket that contains multiple linked
- // entries. It is null if next() needs to find a new bucket.
- Entry next;
-
- /* construct a new HashtableIterator with the supllied type:
- KEYS, VALUES, or ENTRIES */
+ /**
+ * The type of this Iterator: {@link #KEYS}, {@link #VALUES},
+ * or {@link #ENTRIES}.
+ */
+ final int type;
+ /**
+ * The number of modifications to the backing HashMap that we know about.
+ */
+ int knownMod = modCount;
+ /** The number of elements remaining to be returned by next(). */
+ int count = size;
+ /** Current index in the physical hash table. */
+ int idx = buckets.length;
+ /** The last Entry returned by a next() call. */
+ HashEntry last;
+ /**
+ * The next entry that should be returned by next(). It is set to something
+ * if we're iterating through a bucket that contains multiple linked
+ * entries. It is null if next() needs to find a new bucket.
+ */
+ HashEntry next;
+
+ /**
+ * Construct a new HashIterator with the supplied type.
+ * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
+ */
HashIterator(int type)
{
this.type = type;
- knownMod = HashMap.this.modCount;
- count = 0;
- idx = buckets.length;
}
- /** returns true if the Iterator has more elements */
+ /**
+ * Returns true if the Iterator has more elements.
+ * @return true if there are more elements
+ * @throws ConcurrentModificationException if the HashMap was modified
+ */
public boolean hasNext()
{
- if (knownMod != HashMap.this.modCount)
- throw new ConcurrentModificationException();
- return count < size;
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
+ return count > 0;
}
- /** returns the next element in the Iterator's sequential view */
+ /**
+ * Returns the next element in the Iterator's sequential view.
+ * @return the next element
+ * @throws ConcurrentModificationException if the HashMap was modified
+ * @throws NoSuchElementException if there is none
+ */
public Object next()
{
- if (knownMod != HashMap.this.modCount)
- throw new ConcurrentModificationException();
- if (count == size)
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
+ if (count == 0)
throw new NoSuchElementException();
- count++;
- Entry e = null;
- if (next != null)
- e = next;
+ count--;
+ HashEntry e = next;
while (e == null)
- {
- e = buckets[--idx];
- }
+ e = buckets[--idx];
next = e.next;
last = e;
@@ -688,25 +845,22 @@ public class HashMap extends AbstractMap
return e;
}
- /**
- * removes from the backing HashMap the last element which was fetched with the
- * <pre>next()</pre> method
+ /**
+ * Removes from the backing HashMap the last element which was fetched
+ * with the <pre>next()</pre> method.
+ * @throws ConcurrentModificationException if the HashMap was modified
+ * @throws IllegalStateException if called when there is no last element
*/
public void remove()
{
- if (knownMod != HashMap.this.modCount)
- throw new ConcurrentModificationException();
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
if (last == null)
- {
- throw new IllegalStateException();
- }
- else
- {
- HashMap.this.remove(last.key);
- knownMod++;
- count--;
- last = null;
- }
+ throw new IllegalStateException();
+
+ HashMap.this.remove(last.key);
+ knownMod++;
+ last = null;
}
}
}
diff --git a/libjava/java/util/Iterator.java b/libjava/java/util/Iterator.java
index 92620f8c0ac..cc68c87da46 100644
--- a/libjava/java/util/Iterator.java
+++ b/libjava/java/util/Iterator.java
@@ -1,5 +1,5 @@
/* Iterator.java -- Interface for iterating over collections
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -28,20 +28,28 @@ executable file might be covered by the GNU General Public License. */
package java.util;
/**
- * An object which iterates over a collection. An Iterator is used to return the
- * items once only, in sequence, by successive calls to the next method. It is
- * also possible to remove elements from the underlying collection by using the
- * optional remove method. Iterator is intended as a replacement for the
- * Enumeration interface of previous versions of Java, which did not have the
- * remove method and had less conveniently named methods.
+ * An object which iterates over a collection. An Iterator is used to return
+ * the items once only, in sequence, by successive calls to the next method.
+ * It is also possible to remove elements from the underlying collection by
+ * using the optional remove method. Iterator is intended as a replacement
+ * for the Enumeration interface of previous versions of Java, which did not
+ * have the remove method and had less conveniently named methods.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Collection
+ * @see ListIterator
+ * @see Enumeration
+ * @since 1.2
+ * @status updated to 1.4
*/
public interface Iterator
{
/**
- * Tests whether there are elements remaining in the collection.
+ * Tests whether there are elements remaining in the collection. In other
+ * words, calling <code>next()</code> will not throw an exception.
*
- * @return true if there is at least one more element in the collection,
- * that is, if the next call to next will not throw NoSuchElementException.
+ * @return true if there is at least one more element in the collection
*/
boolean hasNext();
@@ -49,20 +57,20 @@ public interface Iterator
* Obtain the next element in the collection.
*
* @return the next element in the collection
- * @exception NoSuchElementException if there are no more elements
+ * @throws NoSuchElementException if there are no more elements
*/
Object next();
/**
- * Remove from the underlying collection the last element returned by next.
- * This method can be called only once after each call to next. It does not
- * affect what will be returned by subsequent calls to next. This operation is
- * optional, it may throw an UnsupportedOperationException.
+ * Remove from the underlying collection the last element returned by next
+ * (optional operation). This method can be called only once after each
+ * call to <code>next()</code>. It does not affect what will be returned
+ * by subsequent calls to next.
*
- * @exception IllegalStateException if next has not yet been called or remove
- * has already been called since the last call to next.
- * @exception UnsupportedOperationException if this Iterator does not support
- * the remove operation.
+ * @throws IllegalStateException if next has not yet been called or remove
+ * has already been called since the last call to next.
+ * @throws UnsupportedOperationException if this Iterator does not support
+ * the remove operation.
*/
void remove();
}
diff --git a/libjava/java/util/LinkedHashMap.java b/libjava/java/util/LinkedHashMap.java
new file mode 100644
index 00000000000..8950d58970b
--- /dev/null
+++ b/libjava/java/util/LinkedHashMap.java
@@ -0,0 +1,474 @@
+/* LinkedHashMap.java -- a class providing hashtable data structure,
+ mapping Object --> Object, with linked list traversal
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
+
+
+package java.util;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * This class provides a hashtable-backed implementation of the
+ * Map interface, with predictable traversal order.
+ * <p>
+ *
+ * It uses a hash-bucket approach; that is, hash collisions are handled
+ * by linking the new node off of the pre-existing node (or list of
+ * nodes). In this manner, techniques such as linear probing (which
+ * can cause primary clustering) and rehashing (which does not fit very
+ * well with Java's method of precomputing hash codes) are avoided. In
+ * addition, this maintains a doubly-linked list which tracks either
+ * insertion or access order. Note that the insertion order is not
+ * modified if a <code>put</code> simply reinserts a key in the map.
+ * <p>
+ *
+ * One of the nice features of tracking insertion order is that you can
+ * copy a hashtable, and regardless of the implementation of the original,
+ * produce the same results when iterating over the copy. This is possible
+ * without needing the overhead of <code>TreeMap</code>.
+ * <p>
+ *
+ * When using this {@link #LinkedHashMap(int, float, boolean) constructor},
+ * you build an access-order mapping. This can be used to implement LRU
+ * caches, for example. In this case, every invocation of <code>put</code>,
+ * <code>putAll</code>, or <code>get</code> moves the accessed entry to
+ * the end of the iteration list. By overriding
+ * {@link #removeEldestEntry(Map.Entry)}, you can also control the
+ * removal of the oldest entry, and thereby do things like keep the map
+ * at a fixed size.
+ * <p>
+ *
+ * Under ideal circumstances (no collisions), LinkedHashMap offers O(1)
+ * performance on most operations (<pre>containsValue()</pre> is,
+ * of course, O(n)). In the worst case (all keys map to the same
+ * hash code -- very unlikely), most operations are O(n).
+ * <p>
+ *
+ * LinkedHashMap accepts the null key and null values. It is not
+ * synchronized, so if you need multi-threaded access, consider using:<br>
+ * <code>Map m = Collections.synchronizedMap(new LinkedHashMap(...));</code>
+ * <p>
+ *
+ * The iterators are <i>fail-fast</i>, meaning that any structural
+ * modification, except for <code>remove()</code> called on the iterator
+ * itself, cause the iterator to throw a
+ * {@link ConcurrentModificationException} rather than exhibit
+ * non-deterministic behavior.
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Object#hashCode()
+ * @see Collection
+ * @see Map
+ * @see HashMap
+ * @see TreeMap
+ * @see Hashtable
+ * @since 1.4
+ */
+public class LinkedHashMap extends HashMap
+{
+ /**
+ * Compatible with JDK 1.4.
+ */
+ private static final long serialVersionUID = 3801124242820219131L;
+
+ /**
+ * The first Entry to iterate over.
+ */
+ transient LinkedHashEntry head;
+
+ /**
+ * The last Entry to iterate over.
+ */
+ transient LinkedHashEntry tail;
+
+ /**
+ * The iteration order of this linked hash map: <code>true</code> for
+ * access-order, <code>false</code> for insertion-order.
+ * @serial
+ */
+ final boolean accessOrder;
+
+ /**
+ * Class to represent an entry in the hash table. Holds a single key-value
+ * pair and the doubly-linked insertion order list.
+ */
+ class LinkedHashEntry extends HashEntry
+ {
+ /** The predecessor in the iteration list, null if this is the eldest. */
+ LinkedHashEntry pred;
+ /** The successor in the iteration list, null if this is the newest. */
+ LinkedHashEntry succ;
+
+ /**
+ * Simple constructor.
+ * @param key the key
+ * @param value the value
+ */
+ LinkedHashEntry(Object key, Object value)
+ {
+ super(key, value);
+ if (head == null)
+ head = this;
+ pred = tail;
+ tail = this;
+ if (pred != null)
+ pred.succ = this;
+ }
+
+ /**
+ * Sets the value of this entry, and shuffles it to the end of
+ * the list if this is in access-order.
+ * @param value the new value
+ * @return the prior value
+ */
+ public Object setValue(Object value)
+ {
+ if (accessOrder && succ != null)
+ {
+ succ.pred = pred;
+ if (pred == null)
+ head = succ;
+ else
+ pred.succ = succ;
+ succ = null;
+ pred = tail;
+ pred.succ = this;
+ tail = this;
+ }
+ return super.setValue(value);
+ }
+
+ /**
+ * Called when this entry is removed from the map. This version does
+ * the necessary bookkeeping to keep the doubly-linked list in order.
+ * @return the value of this key as it is removed
+ */
+ Object cleanup()
+ {
+ if (pred == null)
+ head = succ;
+ else
+ pred.succ = succ;
+ if (succ == null)
+ tail = pred;
+ else
+ succ.pred = pred;
+
+ return value;
+ }
+ }
+
+ /**
+ * Construct a new insertion-ordered LinkedHashMap with the default
+ * capacity (11) and the default load factor (0.75).
+ */
+ public LinkedHashMap()
+ {
+ super();
+ accessOrder = false;
+ }
+
+ /**
+ * Construct a new insertion-ordered LinkedHashMap from the given Map,
+ * with initial capacity the greater of the size of <code>m</code> or
+ * the default of 11.
+ * <p>
+ *
+ * Every element in Map m will be put into this new HashMap, in the
+ * order of m's iterator.
+ *
+ * @param m a Map whose key / value pairs will be put into
+ * the new HashMap. <b>NOTE: key / value pairs
+ * are not cloned in this constructor.</b>
+ * @throws NullPointerException if m is null
+ */
+ public LinkedHashMap(Map m)
+ {
+ super(m);
+ accessOrder = false;
+ }
+
+ /**
+ * Construct a new insertion-ordered LinkedHashMap with a specific
+ * inital capacity and default load factor of 0.75.
+ *
+ * @param initialCapacity the initial capacity of this HashMap (>=0)
+ * @throws IllegalArgumentException if (initialCapacity < 0)
+ */
+ public LinkedHashMap(int initialCapacity)
+ {
+ super(initialCapacity);
+ accessOrder = false;
+ }
+
+ /**
+ * Construct a new insertion-orderd LinkedHashMap with a specific
+ * inital capacity and load factor.
+ *
+ * @param initialCapacity the initial capacity (>=0)
+ * @param loadFactor the load factor (>0, not NaN)
+ * @throws IllegalArgumentException if (initialCapacity < 0) ||
+ * ! (loadFactor > 0.0)
+ */
+ public LinkedHashMap(int initialCapacity, float loadFactor)
+ {
+ super(initialCapacity, loadFactor);
+ accessOrder = false;
+ }
+
+ /**
+ * Construct a new LinkedHashMap with a specific inital capacity, load
+ * factor, and ordering mode.
+ *
+ * @param initialCapacity the initial capacity (>=0)
+ * @param loadFactor the load factor (>0, not NaN)
+ * @param accessOrder true for access-order, false for insertion-order
+ * @throws IllegalArgumentException if (initialCapacity < 0) ||
+ * ! (loadFactor > 0.0)
+ */
+ public LinkedHashMap(int initialCapacity, float loadFactor,
+ boolean accessOrder)
+ {
+ super(initialCapacity, loadFactor);
+ this.accessOrder = accessOrder;
+ }
+
+ /**
+ * Clears the Map so it has no keys. This is O(1).
+ */
+ public void clear()
+ {
+ super.clear();
+ head = null;
+ tail = null;
+ }
+
+ /**
+ * Returns true if this HashMap contains a value <pre>o</pre>, such that
+ * <pre>o.equals(value)</pre>.
+ *
+ * @param value the value to search for in this HashMap
+ * @return true if at least one key maps to the value
+ */
+ public boolean containsValue(Object value)
+ {
+ LinkedHashEntry e = head;
+ while (e != null)
+ {
+ if (value == null ? e.value == null : value.equals(e.value))
+ return true;
+ e = e.succ;
+ }
+ return false;
+ }
+
+ /**
+ * Return the value in this Map associated with the supplied key,
+ * or <pre>null</pre> if the key maps to nothing. If this is an
+ * access-ordered Map and the key is found, this performs structural
+ * modification, moving the key to the newest end of the list. NOTE:
+ * Since the value could also be null, you must use containsKey to
+ * see if this key actually maps to something.
+ *
+ * @param key the key for which to fetch an associated value
+ * @return what the key maps to, if present
+ * @see #put(Object, Object)
+ * @see #containsKey(Object)
+ */
+ public Object get(Object key)
+ {
+ int idx = hash(key);
+ HashEntry e = buckets[idx];
+ while (e != null)
+ {
+ if (key == null ? e.key == null : key.equals(e.key))
+ {
+ if (accessOrder)
+ {
+ modCount++;
+ LinkedHashEntry l = (LinkedHashEntry) e;
+ if (l.succ != null)
+ {
+ l.succ.pred = l.pred;
+ if (l.pred == null)
+ head = l.succ;
+ else
+ l.pred.succ = l.succ;
+ l.succ = null;
+ l.pred = tail;
+ tail.succ = l;
+ tail = l;
+ }
+ }
+ return e.value;
+ }
+ e = e.next;
+ }
+ return null;
+ }
+
+ /**
+ * Returns <code>true</code> if this map should remove the eldest entry.
+ * This method is invoked by all calls to <code>put</code> and
+ * <code>putAll</code> which place a new entry in the map, providing
+ * the implementer an opportunity to remove the eldest entry any time
+ * a new one is added. This can be used to save memory usage of the
+ * hashtable, as well as emulating a cache, by deleting stale entries.
+ * <p>
+ *
+ * For example, to keep the Map limited to 100 entries, override as follows:
+ * <pre>
+ * private static final int MAX_ENTRIES = 100;
+ *
+ * protected boolean removeEldestEntry(Map.Entry eldest)
+ * {
+ * return size() > MAX_ENTRIES;
+ * }
+ * </pre><p>
+ *
+ * Typically, this method does not modify the map, but just uses the
+ * return value as an indication to <code>put</code> whether to proceed.
+ * However, if you override it to modify the map, you must return false
+ * (indicating that <code>put</code> should do nothing), or face
+ * unspecified behavior.
+ * <p>
+ *
+ * This method is called after the eldest entry has been inserted, so
+ * if <code>put</code> was called on a previously empty map, the eldest
+ * entry is the one you just put in! The default implementation just
+ * returns <code>false</code>, so that this map always behaves like
+ * a normal one with unbounded growth.
+ *
+ * @param eldest the eldest element which would be removed if this
+ * returns true. For an access-order map, this is the least
+ * recently accessed; for an insertion-order map, this is the
+ * earliest element inserted.
+ * @return true if <code>eldest</code> should be removed
+ */
+ protected boolean removeEldestEntry(Map.Entry eldest)
+ {
+ return false;
+ }
+
+ /** Helper method called by <code>put</code>, which creates and adds a
+ * new Entry, followed by performing bookkeeping (like removeEldestEntry).
+ *
+ * @param key the key of the new Entry
+ * @param value the value
+ * @param idx the index in buckets where the new Entry belongs
+ * @param callRemove Whether to call the removeEldestEntry method.
+ * @see #put(Object, Object)
+ * @see #removeEldestEntry(Map.Entry)
+ */
+ void addEntry(Object key, Object value, int idx, boolean callRemove)
+ {
+ LinkedHashEntry e = new LinkedHashEntry(key, value);
+
+ e.next = buckets[idx];
+ buckets[idx] = e;
+
+ if (callRemove && removeEldestEntry(head))
+ remove(head);
+ }
+
+ void putAllInternal(Map m)
+ {
+ head = null;
+ tail = null;
+ super.putAllInternal(m);
+ }
+
+ /**
+ * Generates a parameterized iterator. This allows traversal to follow
+ * the doubly-linked list instead of the random bin order of HashMap.
+ * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES}
+ * @return the appropriate iterator
+ */
+ Iterator iterator(final int type)
+ {
+ return new Iterator()
+ {
+ /** The current Entry */
+ LinkedHashEntry current = head;
+
+ /** The previous Entry returned by next() */
+ LinkedHashEntry last;
+
+ /** The number of known modifications to the backing HashMap */
+ int knownMod = modCount;
+
+ /**
+ * Returns true if the Iterator has more elements.
+ * @return true if there are more elements
+ * @throws ConcurrentModificationException if the HashMap was modified
+ */
+ public boolean hasNext()
+ {
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
+ return current != null;
+ }
+
+ /**
+ * Returns the next element in the Iterator's sequential view.
+ * @return the next element
+ * @throws ConcurrentModificationException if the HashMap was modified
+ * @throws NoSuchElementException if there is none
+ */
+ public Object next()
+ {
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
+ if (current == null)
+ throw new NoSuchElementException();
+ last = current;
+ current = current.succ;
+ return type == VALUES ? last.value : type == KEYS ? last.key : last;
+ }
+
+ /**
+ * Removes from the backing HashMap the last element which was fetched
+ * with the <pre>next()</pre> method.
+ * @throws ConcurrentModificationException if the HashMap was modified
+ * @throws IllegalStateException if called when there is no last element
+ */
+ public void remove()
+ {
+ if (knownMod != modCount)
+ throw new ConcurrentModificationException();
+ if (last == null)
+ throw new IllegalStateException();
+
+ LinkedHashMap.this.remove(last.key);
+ knownMod++;
+ last = null;
+ }
+ };
+ }
+}
diff --git a/libjava/java/util/List.java b/libjava/java/util/List.java
index e3e2617e58c..25892d73cdc 100644
--- a/libjava/java/util/List.java
+++ b/libjava/java/util/List.java
@@ -1,5 +1,5 @@
/* List.java -- An ordered collection which allows indexed access
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -25,131 +25,179 @@ This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-// TO DO:
-// ~ Doc comment for the interface itself needs to be put into english.
-// ~ Some more @see clauses might be nice.
-
package java.util;
/**
- * [This is what this doc comment will mention:
- * ~ Additional restrictions on some methods. Others included for completeness.
- * ~ ListIterator and what it can do
- * ~ Positional and iterated access
- * ~ search (but linear time)
- * ~ be careful when containing self as an element, because equals and hashCode
- * loop.]
+ * An ordered collection (also known as a list). This collection allows
+ * access to elements by position, as well as control on where elements
+ * are inserted. Unlike sets, duplicate elements are permitted by this
+ * general contract (if a subclass forbids duplicates, this should be
+ * documented).
+ * <p>
+ *
+ * List places additional requirements on <code>iterator</code>,
+ * <code>add</code>, <code>remove</code>, <code>equals</code>, and
+ * <code>hashCode</code>, in addition to requiring more methods. List
+ * indexing is 0-based (like arrays), although some implementations may
+ * require time proportional to the index to obtain an arbitrary element.
+ * The List interface is incompatible with Set; you cannot implement both
+ * simultaneously.
+ * <p>
+ *
+ * Lists also provide a <code>ListIterator</code> which allows bidirectional
+ * traversal and other features atop regular iterators. Lists can be
+ * searched for arbitrary elements, and allow easy insertion and removal
+ * of multiple elements in one method call.
+ * <p>
+ *
+ * Note: While lists may contain themselves as elements, this leads to
+ * undefined (usually infinite recursive) behavior for some methods like
+ * hashCode or equals.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Collection
+ * @see Set
+ * @see ArrayList
+ * @see LinkedList
+ * @see Vector
+ * @see Arrays#asList(Object[])
+ * @see Collections#nCopies(int, Object)
+ * @see Collections#EMPTY_LIST
+ * @see AbstractList
+ * @see AbstractSequentialList
+ * @since 1.2
+ * @status updated to 1.4
*/
public interface List extends Collection
{
/**
- * Insert an element into the list at a given position.
+ * Insert an element into the list at a given position (optional operation).
+ * This shifts all existing elements from that position to the end one
+ * index to the right. This version of add has no return, since it is
+ * assumed to always succeed if there is no exception.
*
- * @param index the location to insert the item.
- * @param o the object to insert.
- * @exception UnsupportedOperationException if this list does not support the
- * add operation.
- * @exception IndexOutOfBoundsException if index < 0 || index > size()
- * @exception ClassCastException if o cannot be added to this list due to its
- * type.
- * @exception IllegalArgumentException if o cannot be added to this list for
- * some other reason.
+ * @param index the location to insert the item
+ * @param o the object to insert
+ * @throws UnsupportedOperationException if this list does not support the
+ * add operation
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
+ * @throws ClassCastException if o cannot be added to this list due to its
+ * type
+ * @throws IllegalArgumentException if o cannot be added to this list for
+ * some other reason
*/
void add(int index, Object o);
/**
- * Add an element to the end of the list.
+ * Add an element to the end of the list (optional operation). If the list
+ * imposes restraints on what can be inserted, such as no null elements,
+ * this should be documented.
*
- * @param o the object to add.
- * @returns true, as Collection defines this method as returning true if the
- * list was modified as a result of this action, and it always is for a
- * list.
- * @exception UnsupportedOperationException if this list does not support the
- * add operation.
- * @exception ClassCastException if o cannot be added to this list due to its
- * type.
- * @exception IllegalArgumentException if o cannot be added to this list for
- * some other reason.
+ * @param o the object to add
+ * @return true, as defined by Collection for a modified list
+ * @throws UnsupportedOperationException if this list does not support the
+ * add operation
+ * @throws ClassCastException if o cannot be added to this list due to its
+ * type
+ * @throws IllegalArgumentException if o cannot be added to this list for
+ * some other reason
*/
boolean add(Object o);
/**
- * Insert the contents of a collection into the list at a given position.
+ * Insert the contents of a collection into the list at a given position
+ * (optional operation). Shift all elements at that position to the right
+ * by the number of elements inserted. This operation is undefined if
+ * this list is modified during the operation (for example, if you try
+ * to insert a list into itself).
*
- * @param index the location to insert the collection.
- * @param c the collection to insert.
- * @returns true if the list was modified by this action, that is, if c is
- * non-empty.
- * @exception UnsupportedOperationException if this list does not support the
- * addAll operation.
- * @exception IndexOutOfBoundsException if index < 0 || index > size()
- * @exception ClassCastException if some element of c cannot be added to this
- * list due to its type.
- * @exception IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason.
+ * @param index the location to insert the collection
+ * @param c the collection to insert
+ * @return true if the list was modified by this action, that is, if c is
+ * non-empty
+ * @throws UnsupportedOperationException if this list does not support the
+ * addAll operation
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
+ * @throws ClassCastException if some element of c cannot be added to this
+ * list due to its type
+ * @throws IllegalArgumentException if some element of c cannot be added
+ * to this list for some other reason
+ * @throws NullPointerException if the specified collection is null
+ * @see #add(int, Object)
*/
boolean addAll(int index, Collection c);
/**
- * Add the contents of a collection to the end of the list.
+ * Add the contents of a collection to the end of the list (optional
+ * operation). This operation is undefined if this list is modified
+ * during the operation (for example, if you try to insert a list into
+ * itself).
*
- * @param c the collection to add.
- * @returns true if the list was modified by this action, that is, if c is
- * non-empty.
- * @exception UnsupportedOperationException if this list does not support the
- * addAll operation.
- * @exception ClassCastException if some element of c cannot be added to this
- * list due to its type.
- * @exception IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason.
+ * @param c the collection to add
+ * @return true if the list was modified by this action, that is, if c is
+ * non-empty
+ * @throws UnsupportedOperationException if this list does not support the
+ * addAll operation
+ * @throws ClassCastException if some element of c cannot be added to this
+ * list due to its type
+ * @throws IllegalArgumentException if some element of c cannot be added
+ * to this list for some other reason
+ * @throws NullPointerException if the specified collection is null
+ * @see #add(Object)
*/
boolean addAll(Collection c);
/**
* Clear the list, such that a subsequent call to isEmpty() would return
- * true.
+ * true (optional operation).
*
- * @exception UnsupportedOperationException if this list does not support the
- * clear operation.
+ * @throws UnsupportedOperationException if this list does not support the
+ * clear operation
*/
void clear();
/**
* Test whether this list contains a given object as one of its elements.
+ * This is defined as the existence of an element e such that
+ * <code>o == null ? e == null : o.equals(e)</code>.
*
- * @param o the element to look for.
- * @returns true if this list contains an element e such that <code>o ==
- * null ? e == null : o.equals(e)</code>.
+ * @param o the element to look for
+ * @return true if this list contains the element
*/
boolean contains(Object o);
/**
* Test whether this list contains every element in a given collection.
*
- * @param c the collection to test for.
- * @returns true if for every element o in c, contains(o) would return true.
+ * @param c the collection to test for
+ * @return true if for every element o in c, contains(o) would return true
+ * @throws NullPointerException if the collection is null
+ * @see #contains(Object)
*/
boolean containsAll(Collection c);
/**
* Test whether this list is equal to another object. A List is defined to be
* equal to an object if and only if that object is also a List, and the two
- * lists are equal. Two lists l1 and l2 are defined to be equal if and only
+ * lists have the same sequence. Two lists l1 and l2 are equal if and only
* if <code>l1.size() == l2.size()</code>, and for every integer n between 0
* and <code>l1.size() - 1</code> inclusive, <code>l1.get(n) == null ?
* l2.get(n) == null : l1.get(n).equals(l2.get(n))</code>.
*
- * @param o the object to test for equality with this list.
- * @returns true if o is equal to this list.
+ * @param o the object to test for equality with this list
+ * @return true if o is equal to this list
+ * @see Object#equals(Object)
+ * @see #hashCode()
*/
boolean equals(Object o);
/**
* Get the element at a given index in this list.
*
- * @param index the index of the element to be returned.
- * @returns the element at index index in this list.
- * @exception IndexOutOfBoundsException if index < 0 || index >= size()
+ * @param index the index of the element to be returned
+ * @return the element at index index in this list
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
Object get(int index);
@@ -159,14 +207,17 @@ public interface List extends Collection
* <pre>
* hashCode = 1;
* Iterator i = list.iterator();
- * while (i.hasNext()) {
- * Object obj = i.next();
- * hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
- * }
+ * while (i.hasNext())
+ * {
+ * Object obj = i.next();
+ * hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
+ * }
* </pre>
* This ensures that the general contract of Object.hashCode() is adhered to.
*
- * @returns the hash code of this list.
+ * @return the hash code of this list
+ * @see Object#hashCode()
+ * @see #equals(Object)
*/
int hashCode();
@@ -174,22 +225,23 @@ public interface List extends Collection
* Obtain the first index at which a given object is to be found in this
* list.
*
- * @returns the least integer n such that <code>o == null ? get(n) == null :
- * o.equals(get(n))</code>, or -1 if there is no such index.
+ * @param o the object to search for
+ * @return the least integer n such that <code>o == null ? get(n) == null :
+ * o.equals(get(n))</code>, or -1 if there is no such index
*/
int indexOf(Object o);
/**
* Test whether this list is empty, that is, if size() == 0.
*
- * @returns true if this list contains no elements.
+ * @return true if this list contains no elements
*/
boolean isEmpty();
/**
- * Obtain an Iterator over this list.
+ * Obtain an Iterator over this list, whose sequence is the list order.
*
- * @returns an Iterator over the elements of this list, in order.
+ * @return an Iterator over the elements of this list, in order
*/
Iterator iterator();
@@ -197,119 +249,135 @@ public interface List extends Collection
* Obtain the last index at which a given object is to be found in this
* list.
*
- * @returns the greatest integer n such that <code>o == null ? get(n) == null
- * : o.equals(get(n))</code>.
+ * @return the greatest integer n such that <code>o == null ? get(n) == null
+ * : o.equals(get(n))</code>, or -1 if there is no such index
*/
int lastIndexOf(Object o);
/**
* Obtain a ListIterator over this list, starting at the beginning.
*
- * @returns a ListIterator over the elements of this list, in order, starting
- * at the beginning.
+ * @return a ListIterator over the elements of this list, in order, starting
+ * at the beginning
*/
ListIterator listIterator();
/**
* Obtain a ListIterator over this list, starting at a given position.
+ * A first call to next() would return the same as get(index), and a
+ * first call to previous() would return the same as get(index - 1).
*
* @param index the position, between 0 and size() inclusive, to begin the
- * iteration from.
- * @returns a ListIterator over the elements of this list, in order, starting
- * at index.
- * @exception IndexOutOfBoundsException if index < 0 || index > size()
+ * iteration from
+ * @return a ListIterator over the elements of this list, in order, starting
+ * at index
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
*/
ListIterator listIterator(int index);
/**
- * Remove the element at a given position in this list.
+ * Remove the element at a given position in this list (optional operation).
+ * Shifts all remaining elements to the left to fill the gap.
*
- * @param index the position within the list of the object to remove.
- * @returns the object that was removed.
- * @exception UnsupportedOperationException if this list does not support the
- * remove operation.
- * @exception IndexOutOfBoundsException if index < 0 || index > size()
+ * @param index the position within the list of the object to remove
+ * @return the object that was removed
+ * @throws UnsupportedOperationException if this list does not support the
+ * remove operation
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
*/
Object remove(int index);
/**
- * Remove the first occurence of an object from this list. That is, remove
- * the first element e such that <code>o == null ? e == null :
- * o.equals(e)</code>.
+ * Remove the first occurence of an object from this list (optional
+ * operation). That is, remove the first element e such that
+ * <code>o == null ? e == null : o.equals(e)</code>.
*
- * @param o the object to remove.
- * @returns true if the list changed as a result of this call, that is, if
- * the list contained at least one occurrence of o.
- * @exception UnsupportedOperationException if this list does not support the
- * remove operation.
+ * @param o the object to remove
+ * @return true if the list changed as a result of this call, that is, if
+ * the list contained at least one occurrence of o
+ * @throws UnsupportedOperationException if this list does not support the
+ * remove operation
*/
boolean remove(Object o);
/**
- * Remove all elements of a given collection from this list. That is, remove
- * every element e such that c.contains(e).
+ * Remove all elements of a given collection from this list (optional
+ * operation). That is, remove every element e such that c.contains(e).
*
- * @returns true if this list was modified as a result of this call.
- * @exception UnsupportedOperationException if this list does not support the
- * removeAll operation.
+ * @param c the collection to filter out
+ * @return true if this list was modified as a result of this call
+ * @throws UnsupportedOperationException if this list does not support the
+ * removeAll operation
+ * @throws NullPointerException if the collection is null
+ * @see #remove(Object)
+ * @see #contains(Object)
*/
boolean removeAll(Collection c);
/**
* Remove all elements of this list that are not contained in a given
- * collection. That is, remove every element e such that !c.contains(e).
+ * collection (optional operation). That is, remove every element e such
+ * that !c.contains(e).
*
- * @returns true if this list was modified as a result of this call.
- * @exception UnsupportedOperationException if this list does not support the
- * retainAll operation.
+ * @param c the collection to retain
+ * @return true if this list was modified as a result of this call
+ * @throws UnsupportedOperationException if this list does not support the
+ * retainAll operation
+ * @throws NullPointerException if the collection is null
+ * @see #remove(Object)
+ * @see #contains(Object)
*/
boolean retainAll(Collection c);
/**
- * Replace an element of this list with another object.
+ * Replace an element of this list with another object (optional operation).
*
- * @param index the position within this list of the element to be replaced.
- * @param o the object to replace it with.
- * @returns the object that was replaced.
- * @exception UnsupportedOperationException if this list does not support the
- * set operation.
- * @exception IndexOutOfBoundsException if index < 0 || index >= size()
- * @exception ClassCastException if o cannot be added to this list due to its
- * type.
- * @exception IllegalArgumentException if o cannot be added to this list for
- * some other reason.
+ * @param index the position within this list of the element to be replaced
+ * @param o the object to replace it with
+ * @return the object that was replaced
+ * @throws UnsupportedOperationException if this list does not support the
+ * set operation
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
+ * @throws ClassCastException if o cannot be added to this list due to its
+ * type
+ * @throws IllegalArgumentException if o cannot be added to this list for
+ * some other reason
*/
Object set(int index, Object o);
/**
- * Get the number of elements in this list.
+ * Get the number of elements in this list. If the list contains more
+ * than Integer.MAX_VALUE elements, return Integer.MAX_VALUE.
*
- * @returns the number of elements in the list.
+ * @return the number of elements in the list
*/
int size();
/**
* Obtain a List view of a subsection of this list, from fromIndex
- * (inclusive) to toIndex (exclusive). The returned list should be modifiable
- * if and only if this list is modifiable. Changes to the returned list
- * should be reflected in this list. If this list is structurally modified in
+ * (inclusive) to toIndex (exclusive). If the two indices are equal, the
+ * sublist is empty. The returned list should be modifiable if and only
+ * if this list is modifiable. Changes to the returned list should be
+ * reflected in this list. If this list is structurally modified in
* any way other than through the returned list, the result of any subsequent
* operations on the returned list is undefined.
*
* @param fromIndex the index that the returned list should start from
- * (inclusive).
- * @param toIndex the index that the returned list should go to (exclusive).
- * @returns a List backed by a subsection of this list.
- * @exception IndexOutOfBoundsException if fromIndex < 0 || toIndex > size()
- * || fromIndex > toIndex.
+ * (inclusive)
+ * @param toIndex the index that the returned list should go to (exclusive)
+ * @return a List backed by a subsection of this list
+ * @throws IndexOutOfBoundsException if fromIndex &lt; 0
+ * || toIndex &gt; size() || fromIndex &gt; toIndex
+ * @throws IllegalArgumentException if fromIndex &gt; toIndex (according to
+ * AbstractList). Don't you love Sun's inconsistent specifications?
*/
List subList(int fromIndex, int toIndex);
/**
* Copy the current contents of this list into an array.
*
- * @returns an array of type Object[] and length equal to the length of this
- * list, containing the elements currently in this list, in order.
+ * @return an array of type Object[] and length equal to the length of this
+ * list, containing the elements currently in this list, in order
*/
Object[] toArray();
@@ -323,11 +391,12 @@ public interface List extends Collection
* Note: The fact that the following element is set to null is only useful
* if it is known that this list does not contain any null elements.
*
- * @param a the array to copy this list into.
- * @returns an array containing the elements currently in this list, in
- * order.
- * @exception ArrayStoreException if the type of any element of the
- * collection is not a subtype of the element type of a.
+ * @param a the array to copy this list into
+ * @return an array containing the elements currently in this list, in
+ * order
+ * @throws ArrayStoreException if the type of any element of the
+ * collection is not a subtype of the element type of a
+ * @throws NullPointerException if the specified array is null
*/
Object[] toArray(Object[] a);
}
diff --git a/libjava/java/util/ListIterator.java b/libjava/java/util/ListIterator.java
index 8a8d2c74e9d..92f49371a8c 100644
--- a/libjava/java/util/ListIterator.java
+++ b/libjava/java/util/ListIterator.java
@@ -1,5 +1,5 @@
/* ListIterator.java -- Extended Iterator for iterating over ordered lists
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -32,116 +32,128 @@ package java.util;
* elements may be accessed in forward or reverse order, elements may be
* replaced as well as removed, and new elements may be inserted, during the
* traversal of the list.
+ * <p>
+ *
+ * A list with n elements provides n+1 iterator positions (the front, the end,
+ * or between two elements). Note that <code>remove</code> and <code>set</code>
+ * operate on the last element returned, whether it was by <code>next</code>
+ * or <code>previous</code>.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Collection
+ * @see List
+ * @see Iterator
+ * @see Enumeration
+ * @since 1.2
+ * @status updated to 1.4
*/
public interface ListIterator extends Iterator
{
/**
* Tests whether there are elements remaining in the list in the forward
- * direction.
+ * direction. In other words, next() will not fail with a
+ * NoSuchElementException.
*
- * @return true if there is at least one more element in the list in the
- * forward direction, that is, if the next call to next will not throw
- * NoSuchElementException.
+ * @return true if the list continues in the forward direction
*/
boolean hasNext();
/**
* Tests whether there are elements remaining in the list in the reverse
- * direction.
+ * direction. In other words, previous() will not fail with a
+ * NoSuchElementException.
*
- * @return true if there is at least one more element in the list in the
- * reverse direction, that is, if the next call to previous will not throw
- * NoSuchElementException.
+ * @return true if the list continues in the reverse direction
*/
boolean hasPrevious();
/**
* Obtain the next element in the list in the forward direction. Repeated
- * calls to next may be used to iterate over the entire list, or calls to next
- * and previous may be used together to go forwards and backwards. Alternating
- * calls to next and previous will return the same element.
+ * calls to next may be used to iterate over the entire list, or calls to
+ * next and previous may be used together to go forwards and backwards.
+ * Alternating calls to next and previous will return the same element.
*
* @return the next element in the list in the forward direction
- * @exception NoSuchElementException if there are no more elements
+ * @throws NoSuchElementException if there are no more elements
*/
Object next();
/**
* Obtain the next element in the list in the reverse direction. Repeated
- * calls to previous may be used to iterate backwards over the entire list, or
- * calls to next and previous may be used together to go forwards and
+ * calls to previous may be used to iterate backwards over the entire list,
+ * or calls to next and previous may be used together to go forwards and
* backwards. Alternating calls to next and previous will return the same
* element.
*
* @return the next element in the list in the reverse direction
- * @exception NoSuchElementException if there are no more elements
+ * @throws NoSuchElementException if there are no more elements
*/
Object previous();
/**
* Find the index of the element that would be returned by a call to next.
+ * If hasNext() returns false, this returns the list size.
*
- * @return the index of the element that would be returned by a call to next,
- * or list.size() if the iterator is at the end of the list.
+ * @return the index of the element that would be returned by next()
*/
int nextIndex();
/**
- * Find the index of the element that would be returned by a call to previous.
+ * Find the index of the element that would be returned by a call to
+ * previous. If hasPrevious() returns false, this returns -1.
*
- * @return the index of the element that would be returned by a call to
- * previous, or -1 if the iterator is at the beginning of the list.
+ * @return the index of the element that would be returned by previous()
*/
int previousIndex();
/**
- * Insert an element into the list at the current position of the iterator.
- * The element is inserted in between the element that would be returned by
- * previous and the element that would be returned by next. After the
- * insertion, a subsequent call to next is unaffected, but a call to
- * previous returns the item that was added. This operation is optional, it
- * may throw an UnsupportedOperationException.
+ * Insert an element into the list at the current position of the iterator
+ * (optional operation). The element is inserted in between the element that
+ * would be returned by previous and the element that would be returned by
+ * next. After the insertion, a subsequent call to next is unaffected, but
+ * a call to previous returns the item that was added. The values returned
+ * by nextIndex() and previousIndex() are incremented.
*
* @param o the object to insert into the list
- * @exception ClassCastException the object is of a type which cannot be added
- * to this list
- * @exception IllegalArgumentException some other aspect of the object stops
- * it being added to this list
- * @exception UnsupportedOperationException if this ListIterator does not
- * support the add operation
+ * @throws ClassCastException the object is of a type which cannot be added
+ * to this list
+ * @throws IllegalArgumentException some other aspect of the object stops
+ * it being added to this list
+ * @throws UnsupportedOperationException if this ListIterator does not
+ * support the add operation
*/
void add(Object o);
/**
* Remove from the list the element last returned by a call to next or
- * previous. This method may only be called if neither add nor remove have
- * been called since the last call to next or previous. This operation is
- * optional, it may throw an UnsupportedOperationException.
+ * previous (optional operation). This method may only be called if neither
+ * add nor remove have been called since the last call to next or previous.
*
- * @exception IllegalStateException if neither next or previous have been
- * called, or if add or remove has been called since the last call to next
- * or previous.
- * @exception UnsupportedOperationException if this ListIterator does not
- * support the remove operation.
+ * @throws IllegalStateException if neither next or previous have been
+ * called, or if add or remove has been called since the last call
+ * to next or previous
+ * @throws UnsupportedOperationException if this ListIterator does not
+ * support the remove operation
*/
void remove();
/**
* Replace the element last returned by a call to next or previous with a
- * given object. This method may only be called if neither add nor remove have
- * been called since the last call to next or previous. This operation is
- * optional, it may throw an UnsupportedOperationException.
+ * given object (optional operation). This method may only be called if
+ * neither add nor remove have been called since the last call to next or
+ * previous.
*
* @param o the object to replace the element with
- * @exception ClassCastException the object is of a type which cannot be added
- * to this list
- * @exception IllegalArgumentException some other aspect of the object stops
- * it being added to this list
- * @exception IllegalStateException if neither next or previous have been
- * called, or if add or remove has been called since the last call to next
- * or previous.
- * @exception UnsupportedOperationException if this ListIterator does not
- * support the set operation.
+ * @throws ClassCastException the object is of a type which cannot be added
+ * to this list
+ * @throws IllegalArgumentException some other aspect of the object stops
+ * it being added to this list
+ * @throws IllegalStateException if neither next or previous have been
+ * called, or if add or remove has been called since the last call
+ * to next or previous
+ * @throws UnsupportedOperationException if this ListIterator does not
+ * support the set operation
*/
void set(Object o);
}
diff --git a/libjava/java/util/Map.java b/libjava/java/util/Map.java
index b1d43269711..2cd22b32e05 100644
--- a/libjava/java/util/Map.java
+++ b/libjava/java/util/Map.java
@@ -1,5 +1,6 @@
-/* Map.java -- An object that maps keys to values
- Copyright (C) 1998 Free Software Foundation, Inc.
+/* Map.java: interface Map -- An object that maps keys to values
+ interface Map.Entry -- an Entry in a Map
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -25,34 +26,293 @@ This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-// TO DO:
-// ~ Doc comments for everything.
-
package java.util;
+/**
+ * An object that maps keys onto values. Keys cannot be duplicated. This
+ * interface replaces the obsolete {@link Dictionary} abstract class.
+ * <p>
+ *
+ * The map has three collection views, which are backed by the map
+ * (modifications on one show up on the other): a set of keys, a collection
+ * of values, and a set of key-value mappings. Some maps have a guaranteed
+ * order, but not all do.
+ * <p>
+ *
+ * Note: Be careful about using mutable keys. Behavior is unspecified if
+ * a key's comparison behavior is changed after the fact. As a corollary
+ * to this rule, don't use a Map as one of its own keys or values, as it makes
+ * hashCode and equals have undefined behavior.
+ * <p>
+ *
+ * All maps are recommended to provide a no argument constructor, which builds
+ * an empty map, and one that accepts a Map parameter and copies the mappings
+ * (usually by putAll), to create an equivalent map. Unfortunately, Java
+ * cannot enforce these suggestions.
+ * <p>
+ *
+ * The map may be unmodifiable, in which case unsupported operations will
+ * throw an UnsupportedOperationException. Note that some operations may be
+ * safe, such as putAll(m) where m is empty, even if the operation would
+ * normally fail with a non-empty argument.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see HashMap
+ * @see TreeMap
+ * @see Hashtable
+ * @see SortedMap
+ * @see Collection
+ * @see Set
+ * @since 1.2
+ * @status updated to 1.4
+ */
public interface Map
{
+ /**
+ * Remove all entries from this Map (optional operation).
+ *
+ * @throws UnsupportedOperationException if clear is not supported
+ */
public void clear();
+
+ /**
+ * Returns true if this contains a mapping for the given key.
+ *
+ * @param key the key to search for
+ * @return true if the map contains the key
+ * @throws ClassCastException if the key is of an inappropriate type
+ * @throws NullPointerException if key is <code>null</code> but the map
+ * does not permit null keys
+ */
public boolean containsKey(Object key);
+
+ /**
+ * Returns true if this contains at least one mapping with the given value.
+ * In other words, returns true if a value v exists where
+ * <code>(value == null ? v == null : value.equals(v))</code>. This usually
+ * requires linear time.
+ *
+ * @param value the value to search for
+ * @return true if the map contains the value
+ */
public boolean containsValue(Object value);
+
+ /**
+ * Returns a set view of the mappings in this Map. Each element in the
+ * set is a Map.Entry. The set is backed by the map, so that changes in
+ * one show up in the other. Modifications made while an iterator is
+ * in progress cause undefined behavior. If the set supports removal,
+ * these methods remove the underlying mapping from the map:
+ * <code>Iterator.remove</code>, <code>Set.remove</code>,
+ * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
+ * Element addition, via <code>add</code> or <code>addAll</code>, is
+ * not supported via this set.
+ *
+ * @return the set view of all mapping entries
+ * @see Map.Entry
+ */
public Set entrySet();
+
+ /**
+ * Compares the specified object with this map for equality. Returns
+ * <code>true</code> if the other object is a Map with the same mappings,
+ * that is,<br>
+ * <code>o instanceof Map && entrySet().equals(((Map) o).entrySet();</code>
+ * This allows comparison of maps, regardless of implementation.
+ *
+ * @param o the object to be compared
+ * @return true if the object equals this map
+ * @see Set#equals(Object)
+ */
public boolean equals(Object o);
+
+ /**
+ * Returns the value mapped by the given key. Returns <code>null</code> if
+ * there is no mapping. However, in Maps that accept null values, you
+ * must rely on <code>containsKey</code> to determine if a mapping exists.
+ *
+ * @param key the key to look up
+ * @return the value associated with the key, or null if key not in map
+ * @throws ClassCastException if the key is an inappropriate type
+ * @throws NullPointerException if this map does not accept null keys
+ * @see #containsKey(Object)
+ */
public Object get(Object key);
+
+ /**
+ * Associates the given key to the given value (optional operation). If the
+ * map already contains the key, its value is replaced. Be aware that in
+ * a map that permits <code>null</code> values, a null return does not
+ * always imply that the mapping was created.
+ *
+ * @param key the key to map
+ * @param value the value to be mapped
+ * @return the previous value of the key, or null if there was no mapping
+ * @throws UnsupportedOperationException if the operation is not supported
+ * @throws ClassCastException if the key or value is of the wrong type
+ * @throws IllegalArgumentException if something about this key or value
+ * prevents it from existing in this map
+ * @throws NullPointerException if the map forbids null keys or values
+ * @see #containsKey(Object)
+ */
public Object put(Object key, Object value);
+
+ /**
+ * Returns the hash code for this map. This is the sum of all hashcodes
+ * for each Map.Entry object in entrySet. This allows comparison of maps,
+ * regardless of implementation, and satisfies the contract of
+ * Object.hashCode.
+ *
+ * @return the hash code
+ * @see Map.Entry#hashCode()
+ */
public int hashCode();
+
+ /**
+ * Returns true if the map contains no mappings.
+ *
+ * @return true if the map is empty
+ */
public boolean isEmpty();
+
+ /**
+ * Returns a set view of the keys in this Map. The set is backed by the
+ * map, so that changes in one show up in the other. Modifications made
+ * while an iterator is in progress cause undefined behavior. If the set
+ * supports removal, these methods remove the underlying mapping from
+ * the map: <code>Iterator.remove</code>, <code>Set.remove</code>,
+ * <code>removeAll</code>, <code>retainAll</code>, and <code>clear</code>.
+ * Element addition, via <code>add</code> or <code>addAll</code>, is
+ * not supported via this set.
+ *
+ * @return the set view of all keys
+ */
public Set keySet();
+
+ /**
+ * Copies all entries of the given map to this one (optional operation). If
+ * the map already contains a key, its value is replaced.
+ *
+ * @param m the mapping to load into this map
+ * @throws UnsupportedOperationException if the operation is not supported
+ * @throws ClassCastException if a key or value is of the wrong type
+ * @throws IllegalArgumentException if something about a key or value
+ * prevents it from existing in this map
+ * @throws NullPointerException if the map forbids null keys or values, or
+ * if <code>m</code> is null.
+ * @see #put(Object, Object)
+ */
public void putAll(Map m);
+
+ /**
+ * Removes the mapping for this key if present (optional operation). If
+ * the key is not present, this returns null. Note that maps which permit
+ * null values may also return null if the key was removed.
+ *
+ * @param key the key to remove
+ * @return the value the key mapped to, or null if not present
+ * @throws UnsupportedOperationException if deletion is unsupported
+ */
public Object remove(Object o);
+
+ /**
+ * Returns the number of key-value mappings in the map. If there are more
+ * than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE.
+ *
+ * @return the number of mappings
+ */
public int size();
+
+ /**
+ * Returns a collection (or bag) view of the values in this Map. The
+ * collection is backed by the map, so that changes in one show up in
+ * the other. Modifications made while an iterator is in progress cause
+ * undefined behavior. If the collection supports removal, these methods
+ * remove the underlying mapping from the map: <code>Iterator.remove</code>,
+ * <code>Collection.remove</code>, <code>removeAll</code>,
+ * <code>retainAll</code>, and <code>clear</code>. Element addition, via
+ * <code>add</code> or <code>addAll</code>, is not supported via this
+ * collection.
+ *
+ * @return the collection view of all values
+ */
public Collection values();
+ /**
+ * A map entry (key-value pair). The Map.entrySet() method returns a set
+ * view of these objects; there is no other valid way to come across them.
+ * These objects are only valid for the duration of an iteration; in other
+ * words, if you mess with one after modifying the map, you are asking
+ * for undefined behavior.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Map
+ * @see Map#entrySet()
+ * @since 1.2
+ * @status updated to 1.4
+ */
public static interface Entry
{
+ /**
+ * Get the key corresponding to this entry.
+ *
+ * @return the key
+ */
public Object getKey();
+
+ /**
+ * Get the value corresponding to this entry. If you already called
+ * Iterator.remove(), this is undefined.
+ *
+ * @return the value
+ */
public Object getValue();
+
+ /**
+ * Replaces the value with the specified object (optional operation).
+ * This writes through to the map, and is undefined if you already
+ * called Iterator.remove().
+ *
+ * @param value the new value to store
+ * @return the old value
+ * @throws UnsupportedOperationException if the operation is not supported
+ * @throws ClassCastException if the value is of the wrong type
+ * @throws IllegalArgumentException if something about the value
+ * prevents it from existing in this map
+ * @throws NullPointerException if the map forbids null values
+ */
public Object setValue(Object value);
+
+ /**
+ * Returns the hash code of the entry. This is defined as the exclusive-or
+ * of the hashcodes of the key and value (using 0 for null). In other
+ * words, this must be:
+ * <pre>
+ * (getKey() == null ? 0 : getKey().hashCode()) ^
+ * (getValue() == null ? 0 : getValue().hashCode())
+ * </pre>
+ *
+ * @return the hash code
+ */
public int hashCode();
+
+ /**
+ * Compares the specified object with this entry. Returns true only if
+ * the object is a mapping of identical key and value. In other words,
+ * this must be:
+ * <pre>
+ * (o instanceof Map.Entry)
+ * && (getKey() == null ? ((HashMap) o).getKey() == null
+ * : getKey().equals(((HashMap) o).getKey()))
+ * && (getValue() == null ? ((HashMap) o).getValue() == null
+ * : getValue().equals(((HashMap) o).getValue()))
+ * </pre>
+ *
+ * @param o the object to compare
+ * @return true if it is equal
+ */
public boolean equals(Object o);
}
}
diff --git a/libjava/java/util/RandomAccess.java b/libjava/java/util/RandomAccess.java
new file mode 100644
index 00000000000..dd2b140166f
--- /dev/null
+++ b/libjava/java/util/RandomAccess.java
@@ -0,0 +1,53 @@
+/* RandomAccess.java -- A tagging interface that lists can use to tailor
+ operations to the correct algorithm
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
+
+
+package java.util;
+
+/**
+ * Marker interface used to inform <code>List</code> implementations that
+ * they support fast (usually constant time) random access. This allows
+ * generic list algorithms to tailor their behavior based on the list
+ * type.
+ * <p>
+ *
+ * For example, some sorts are n*log(n) on an array, but decay to quadratic
+ * time on a linked list. As a rule of thumb, this interface should be
+ * used is this loop:<br>
+ * <code>for (int i = 0, n = list.size(); i &lt; n; i++) list.get(i);</code>
+ * <br>runs faster than this loop:<br>
+ * <code>for (Iterator i = list.iterator(); i.hasNext(); ) i.next();</code>
+ *
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see List
+ * @since 1.4
+ * @status updated to 1.4
+ */
+public interface RandomAccess
+{
+ // Tagging interface only.
+}
diff --git a/libjava/java/util/Set.java b/libjava/java/util/Set.java
index 3c8c09be3d3..c22228c2122 100644
--- a/libjava/java/util/Set.java
+++ b/libjava/java/util/Set.java
@@ -1,5 +1,5 @@
/* Set.java -- A collection that prohibits duplicates
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -25,25 +25,208 @@ This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-// TO DO:
-// ~ Doc comments for everything.
-
package java.util;
+/**
+ * A collection that contains no duplicates. In other words, for two set
+ * elements e1 and e2, <code>e1.equals(e2)</code> returns false. There
+ * are additional stipulations on <code>add</code>, <code>equals</code>
+ * and <code>hashCode</code>, as well as the requirements that constructors
+ * do not permit duplicate elements. The Set interface is incompatible with
+ * List; you cannot implement both simultaneously.
+ * <p>
+ *
+ * Note: Be careful about using mutable objects in sets. In particular,
+ * if a mutable object changes to become equal to another set element, you
+ * have violated the contract. As a special case of this, a Set is not
+ * allowed to be an element of itself, without risking undefined behavior.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Collection
+ * @see List
+ * @see SortedSet
+ * @see HashSet
+ * @see TreeSet
+ * @see LinkedHashSet
+ * @see AbstractSet
+ * @see Collections#singleton(Object)
+ * @see Collections#EMPTY_SET
+ * @since 1.2
+ * @status updated to 1.4
+ */
public interface Set extends Collection
{
+ /**
+ * Adds the specified element to the set if it is not already present
+ * (optional operation). In particular, the comparison algorithm is
+ * <code>o == null ? e == null : o.equals(e)</code>. Sets need not permit
+ * all values, and may document what exceptions will be thrown if
+ * a value is not permitted.
+ *
+ * @param o the object to add
+ * @return true if the object was not previously in the set
+ * @throws UnsupportedOperationException if this operation is not allowed
+ * @throws ClassCastException if the class of o prevents it from being added
+ * @throws IllegalArgumentException if some aspect of o prevents it from
+ * being added
+ * @throws NullPointerException if null is not permitted in this set
+ */
boolean add(Object o);
+
+ /**
+ * Adds all of the elements of the given collection to this set (optional
+ * operation). If the argument is also a Set, this returns the mathematical
+ * <i>union</i> of the two. The behavior is unspecified if the set is
+ * modified while this is taking place.
+ *
+ * @param c the collection to add
+ * @return true if the set changed as a result
+ * @throws UnsupportedOperationException if this operation is not allowed
+ * @throws ClassCastException if the class of an element prevents it from
+ * being added
+ * @throws IllegalArgumentException if something about an element prevents
+ * it from being added
+ * @throws NullPointerException if null is not permitted in this set, or
+ * if the argument c is null
+ * @see #add(Object)
+ */
boolean addAll(Collection c);
+
+ /**
+ * Removes all elements from this set (optional operation). This set will
+ * be empty afterwords, unless an exception occurs.
+ *
+ * @throws UnsupportedOperationException if this operation is not allowed
+ */
void clear();
+
+ /**
+ * Returns true if the set contains the specified element. In other words,
+ * this looks for <code>o == null ? e == null : o.equals(e)</code>.
+ *
+ * @param o the object to look for
+ * @return true if it is found in the set
+ */
boolean contains(Object o);
+
+ /**
+ * Returns true if this set contains all elements in the specified
+ * collection. If the argument is also a set, this is the <i>subset</i>
+ * relationship.
+ *
+ * @param c the collection to check membership in
+ * @return true if all elements in this set are in c
+ * @throws NullPointerException if c is null
+ * @see #contains(Object)
+ */
boolean containsAll(Collection c);
+
+ /**
+ * Compares the specified object to this for equality. For sets, the object
+ * must be a set, the two must have the same size, and every element in
+ * one must be in the other.
+ *
+ * @param o the object to compare to
+ * @return true if it is an equal set
+ */
boolean equals(Object o);
+
+ /**
+ * Returns the hash code for this set. In order to satisfy the contract of
+ * equals, this is the sum of the hashcode of all elements in the set.
+ *
+ * @return the sum of the hashcodes of all set elements
+ */
int hashCode();
+
+ /**
+ * Returns true if the set contains no elements.
+ *
+ * @return true if the set is empty
+ */
boolean isEmpty();
+
+ /**
+ * Returns an iterator over the set. The iterator has no specific order,
+ * unless further specified.
+ *
+ * @return a set iterator
+ */
Iterator iterator();
+
+ /**
+ * Removes the specified element from this set (optional operation). If
+ * an element e exists, <code>o == null ? e == null : o.equals(e)</code>,
+ * it is removed from the set.
+ *
+ * @param o the object to remove
+ * @return true if the set changed (an object was removed)
+ * @throws UnsupportedOperationException if this operation is not allowed
+ */
boolean remove(Object o);
+
+ /**
+ * Removes from this set all elements contained in the specified collection
+ * (optional operation). If the argument is a set, this returns the
+ * <i>asymmetric set difference</i> of the two sets.
+ *
+ * @param c the collection to remove from this set
+ * @return true if this set changed as a result
+ * @throws UnsupportedOperationException if this operation is not allowed
+ * @throws NullPointerException if c is null
+ * @see #remove(Object)
+ */
boolean removeAll(Collection c);
+
+ /**
+ * Retains only the elements in this set that are also in the specified
+ * collection (optional operation). If the argument is also a set, this
+ * performs the <i>intersection</i> of the two sets.
+ *
+ * @param c the collection to keep
+ * @return true if this set was modified
+ * @throws UnsupportedOperationException if this operation is not allowed
+ * @throws NullPointerException if c is null
+ * @see #remove(Object)
+ */
boolean retainAll(Collection c);
+
+ /**
+ * Returns the number of elements in the set. If there are more
+ * than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE. This is
+ * the <i>cardinality</i> of the set.
+ *
+ * @return the number of elements
+ */
int size();
+
+ /**
+ * Returns an array containing the elements of this set. If the set
+ * makes a guarantee about iteration order, the array has the same
+ * order. The array is distinct from the set; modifying one does not
+ * affect the other.
+ *
+ * @return an array of this set's elements
+ * @see #toArray(Object[])
+ */
Object[] toArray();
+
+ /**
+ * Returns an array containing the elements of this set, of the same runtime
+ * type of the argument. If the given set is large enough, it is reused,
+ * and null is inserted in the first unused slot. Otherwise, reflection
+ * is used to build a new array. If the set makes a guarantee about iteration
+ * order, the array has the same order. The array is distinct from the set;
+ * modifying one does not affect the other.
+ *
+ * @param a the array to determine the return type; if it is big enough
+ * it is used and returned
+ * @return an array holding the elements of the set
+ * @throws ArrayStoreException if the runtime type of a is not a supertype
+ * of all elements in the set
+ * @throws NullPointerException if a is null
+ * @see #toArray()
+ */
+ Object[] toArray(Object[] a);
}
diff --git a/libjava/java/util/SortedMap.java b/libjava/java/util/SortedMap.java
index 2de57a175ac..5be6c19d919 100644
--- a/libjava/java/util/SortedMap.java
+++ b/libjava/java/util/SortedMap.java
@@ -1,5 +1,5 @@
/* SortedMap.java -- A map that makes guarantees about the order of its keys
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -25,17 +25,135 @@ This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-// TO DO:
-// ~ Doc comments for everything.
-
package java.util;
+/**
+ * A map which guarantees its key's iteration order. The entries in the
+ * map are related by the <i>natural ordering</i> of the keys if they
+ * are Comparable, or by the provided Comparator. Additional operations
+ * take advantage of the sorted nature of the map.
+ * <p>
+ *
+ * All keys entered in the map must be mutually comparable; in other words,
+ * <code>k1.compareTo(k2)</code> or <code>comparator.compare(k1, k2)</code>
+ * must not throw a ClassCastException. The ordering must be <i>consistent
+ * with equals</i> (see {@link Comparator} for this definition), if the
+ * map is to obey the general contract of the Map interface. If not,
+ * the results are well-defined, but probably not what you wanted.
+ * <p>
+ *
+ * It is recommended that all implementing classes provide four constructors:
+ * 1) one that takes no arguments and builds an empty map sorted by natural
+ * order of the keys; 2) one that takes a Comparator for the sorting order;
+ * 3) one that takes a Map and sorts according to the natural order of its
+ * keys; and 4) one that takes a SortedMap and sorts by the same comparator.
+ * Unfortunately, the Java language does not provide a way to enforce this.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Map
+ * @see TreeMap
+ * @see SortedSet
+ * @see Comparable
+ * @see Comparator
+ * @see Collection
+ * @see ClassCastException
+ * @since 1.2
+ * @status updated to 1.4
+ */
public interface SortedMap extends Map
{
+ /**
+ * Returns the comparator used in sorting this map, or null if it is
+ * the keys' natural ordering.
+ *
+ * @return the sorting comparator
+ */
Comparator comparator();
+
+ /**
+ * Returns the first (lowest sorted) key in the map.
+ *
+ * @return the first key
+ */
Object firstKey();
+
+ /**
+ * Returns a view of the portion of the map strictly less than toKey. The
+ * view is backed by this map, so changes in one show up in the other.
+ * The submap supports all optional operations of the original.
+ * <p>
+ *
+ * The returned map throws an IllegalArgumentException any time a key is
+ * used which is out of the range of toKey. Note that the endpoint is not
+ * included; if you want the endpoint, pass the successor object in to
+ * toKey. For example, for Strings, you can request
+ * <code>headMap(limit + "\0")</code>.
+ *
+ * @param toKey the exclusive upper range of the submap
+ * @return the submap
+ * @throws ClassCastException if toKey is not comparable to the map contents
+ * @throws IllegalArgumentException if this is a subMap, and toKey is out
+ * of range
+ * @throws NullPointerException if toKey is null but the map does not allow
+ * null keys
+ */
SortedMap headMap(Object toKey);
+
+ /**
+ * Returns the last (highest sorted) key in the map.
+ *
+ * @return the last key
+ */
Object lastKey();
+
+ /**
+ * Returns a view of the portion of the map greater than or equal to
+ * fromKey, and strictly less than toKey. The view is backed by this map,
+ * so changes in one show up in the other. The submap supports all
+ * optional operations of the original.
+ * <p>
+ *
+ * The returned map throws an IllegalArgumentException any time a key is
+ * used which is out of the range of fromKey and toKey. Note that the
+ * lower endpoint is included, but the upper is not; if you want to
+ * change the inclusion or exclusion of an endpoint, pass the successor
+ * object in instead. For example, for Strings, you can request
+ * <code>subMap(lowlimit + "\0", highlimit + "\0")</code> to reverse
+ * the inclusiveness of both endpoints.
+ *
+ * @param fromKey the inclusive lower range of the submap
+ * @param toKey the exclusive upper range of the submap
+ * @return the submap
+ * @throws ClassCastException if fromKey or toKey is not comparable to
+ * the map contents
+ * @throws IllegalArgumentException if this is a subMap, and fromKey or
+ * toKey is out of range
+ * @throws NullPointerException if fromKey or toKey is null but the map
+ * does not allow null keys
+ */
SortedMap subMap(Object fromKey, Object toKey);
+
+ /**
+ * Returns a view of the portion of the map greater than or equal to
+ * fromKey. The view is backed by this map, so changes in one show up
+ * in the other. The submap supports all optional operations of the original.
+ * <p>
+ *
+ * The returned map throws an IllegalArgumentException any time a key is
+ * used which is out of the range of fromKey. Note that the endpoint is
+ * included; if you do not want the endpoint, pass the successor object in
+ * to fromKey. For example, for Strings, you can request
+ * <code>tailMap(limit + "\0")</code>.
+ *
+ * @param fromKey the inclusive lower range of the submap
+ * @return the submap
+ * @throws ClassCastException if fromKey is not comparable to the map
+ * contents
+ * @throws IllegalArgumentException if this is a subMap, and fromKey is out
+ * of range
+ * @throws NullPointerException if fromKey is null but the map does not allow
+ * null keys
+ */
SortedMap tailMap(Object fromKey);
}
diff --git a/libjava/java/util/SortedSet.java b/libjava/java/util/SortedSet.java
index f72dd66ef97..ea39811dd67 100644
--- a/libjava/java/util/SortedSet.java
+++ b/libjava/java/util/SortedSet.java
@@ -1,6 +1,6 @@
-/* SortedSet.java -- A set that makes guarantees about the order of its
+/* SortedSet.java -- A set that makes guarantees about the order of its
elements
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -26,17 +26,137 @@ This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-// TO DO:
-// ~ Doc comments for everything.
-
package java.util;
+/**
+ * A set which guarantees its iteration order. The elements in the set
+ * are related by the <i>natural ordering</i> if they are Comparable, or
+ * by the provided Comparator. Additional operations take advantage of
+ * the sorted nature of the set.
+ * <p>
+ *
+ * All elements entered in the set must be mutually comparable; in other words,
+ * <code>k1.compareTo(k2)</code> or <code>comparator.compare(k1, k2)</code>
+ * must not throw a ClassCastException. The ordering must be <i>consistent
+ * with equals</i> (see {@link Comparator} for this definition), if the
+ * map is to obey the general contract of the Set interface. If not,
+ * the results are well-defined, but probably not what you wanted.
+ * <p>
+ *
+ * It is recommended that all implementing classes provide four constructors:
+ * 1) one that takes no arguments and builds an empty set sorted by natural
+ * order of the elements; 2) one that takes a Comparator for the sorting order;
+ * 3) one that takes a Set and sorts according to the natural order of its
+ * elements; and 4) one that takes a SortedSet and sorts by the same
+ * comparator. Unfortunately, the Java language does not provide a way to
+ * enforce this.
+ *
+ * @author Original author unknown
+ * @author Eric Blake <ebb9@email.byu.edu>
+ * @see Set
+ * @see TreeSet
+ * @see SortedMap
+ * @see Collection
+ * @see Comparable
+ * @see Comparator
+ * @see ClassCastException
+ * @since 1.2
+ * @status updated to 1.4
+ */
public interface SortedSet extends Set
{
+ /**
+ * Returns the comparator used in sorting this set, or null if it is
+ * the elements' natural ordering.
+ *
+ * @return the sorting comparator
+ */
Comparator comparator();
+
+ /**
+ * Returns the first (lowest sorted) element in the map.
+ *
+ * @return the first element
+ */
Object first();
+
+ /**
+ * Returns a view of the portion of the set strictly less than toElement. The
+ * view is backed by this set, so changes in one show up in the other.
+ * The subset supports all optional operations of the original.
+ * <p>
+ *
+ * The returned set throws an IllegalArgumentException any time an element is
+ * used which is out of the range of toElement. Note that the endpoint is not
+ * included; if you want the endpoint, pass the successor object in to
+ * toElement. For example, for Strings, you can request
+ * <code>headSet(limit + "\0")</code>.
+ *
+ * @param toElement the exclusive upper range of the subset
+ * @return the subset
+ * @throws ClassCastException if toElement is not comparable to the set
+ * contents
+ * @throws IllegalArgumentException if this is a subSet, and toElement is out
+ * of range
+ * @throws NullPointerException if toElement is null but the map does not
+ * allow null elements
+ */
SortedSet headSet(Object toElement);
+
+ /**
+ * Returns the last (highest sorted) element in the map.
+ *
+ * @return the last element
+ */
Object last();
+
+ /**
+ * Returns a view of the portion of the set greater than or equal to
+ * fromElement, and strictly less than toElement. The view is backed by
+ * this set, so changes in one show up in the other. The subset supports all
+ * optional operations of the original.
+ * <p>
+ *
+ * The returned set throws an IllegalArgumentException any time an element is
+ * used which is out of the range of fromElement and toElement. Note that the
+ * lower endpoint is included, but the upper is not; if you want to
+ * change the inclusion or exclusion of an endpoint, pass the successor
+ * object in instead. For example, for Strings, you can request
+ * <code>subSet(lowlimit + "\0", highlimit + "\0")</code> to reverse
+ * the inclusiveness of both endpoints.
+ *
+ * @param fromElement the inclusive lower range of the subset
+ * @param toElement the exclusive upper range of the subset
+ * @return the subset
+ * @throws ClassCastException if fromElement or toElement is not comparable
+ * to the set contents
+ * @throws IllegalArgumentException if this is a subSet, and fromElement or
+ * toElement is out of range
+ * @throws NullPointerException if fromElement or toElement is null but the
+ * set does not allow null elements
+ */
SortedSet subSet(Object fromElement, Object toElement);
+
+ /**
+ * Returns a view of the portion of the set greater than or equal to
+ * fromElement. The view is backed by this set, so changes in one show up
+ * in the other. The subset supports all optional operations of the original.
+ * <p>
+ *
+ * The returned set throws an IllegalArgumentException any time an element is
+ * used which is out of the range of fromElement. Note that the endpoint is
+ * included; if you do not want the endpoint, pass the successor object in
+ * to fromElement. For example, for Strings, you can request
+ * <code>tailSet(limit + "\0")</code>.
+ *
+ * @param fromElement the inclusive lower range of the subset
+ * @return the subset
+ * @throws ClassCastException if fromElement is not comparable to the set
+ * contents
+ * @throws IllegalArgumentException if this is a subSet, and fromElement is
+ * out of range
+ * @throws NullPointerException if fromElement is null but the set does not
+ * allow null elements
+ */
SortedSet tailSet(Object fromElement);
}