Commit 7a95ae6b by Tom Tromey Committed by Tom Tromey

Makefile.in: Rebuilt.

	* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Removed
	EnumerationChain, added DoubleEnumeration.
	(nat_source_files): Added natResourceBundle.cc.
	* java/util/natResourceBundle.cc: New file.
	* gnu/java/util/DoubleEnumeration.java: New file.
	* gnu/gcj/util/EnumerationChain.java: Removed.
	* java/beans/VetoableChangeSupport.java: Merged with Classpath.
	* java/util/ResourceBundle.java: Merged with Classpath.
	* java/util/StringTokenizer.java: Merged with Classpath.
	* java/util/Locale.java: Merged with Classpath.
	* java/util/Random.java: Merged with Classpath.
	* java/util/PropertyResourceBundle.java: Merged with Classpath.
	* java/util/ListResourceBundle.java: Merged with Classpath.
	* java/util/ConcurrentModificationException.java: Re-merged with
	Classpath.
	* java/util/EmptyStackException.java: Likewise.
	* java/util/MissingResourceException.java: Likewise.
	* java/util/NoSuchElementException.java: Likewise.
	* java/util/TooManyListenersException.java: Likewise.

From-SVN: r45335
parent fb9282f9
2001-08-31 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Removed
EnumerationChain, added DoubleEnumeration.
(nat_source_files): Added natResourceBundle.cc.
* java/util/natResourceBundle.cc: New file.
* gnu/java/util/DoubleEnumeration.java: New file.
* gnu/gcj/util/EnumerationChain.java: Removed.
* java/beans/VetoableChangeSupport.java: Merged with Classpath.
* java/util/ResourceBundle.java: Merged with Classpath.
* java/util/StringTokenizer.java: Merged with Classpath.
* java/util/Locale.java: Merged with Classpath.
* java/util/Random.java: Merged with Classpath.
* java/util/PropertyResourceBundle.java: Merged with Classpath.
* java/util/ListResourceBundle.java: Merged with Classpath.
* java/util/ConcurrentModificationException.java: Re-merged with
Classpath.
* java/util/EmptyStackException.java: Likewise.
* java/util/MissingResourceException.java: Likewise.
* java/util/NoSuchElementException.java: Likewise.
* java/util/TooManyListenersException.java: Likewise.
* java/io/ByteArrayOutputStream.java: Re-merged with Classpath.
* java/io/OptionalDataException.java: Merged with Classpath.
......
......@@ -1128,7 +1128,6 @@ gnu/gcj/text/LocaleData_en.java \
gnu/gcj/text/LocaleData_en_US.java \
gnu/gcj/text/SentenceBreakIterator.java \
gnu/gcj/text/WordBreakIterator.java \
gnu/gcj/util/EnumerationChain.java \
gnu/java/io/ClassLoaderObjectInputStream.java \
gnu/java/io/NullOutputStream.java \
gnu/java/io/ObjectIdentityWrapper.java \
......@@ -1143,6 +1142,7 @@ 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/util/DoubleEnumeration.java \
java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
java/lang/ref/ReferenceQueue.java \
......@@ -1492,6 +1492,7 @@ 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
......
......@@ -878,7 +878,6 @@ gnu/gcj/text/LocaleData_en.java \
gnu/gcj/text/LocaleData_en_US.java \
gnu/gcj/text/SentenceBreakIterator.java \
gnu/gcj/text/WordBreakIterator.java \
gnu/gcj/util/EnumerationChain.java \
gnu/java/io/ClassLoaderObjectInputStream.java \
gnu/java/io/NullOutputStream.java \
gnu/java/io/ObjectIdentityWrapper.java \
......@@ -893,6 +892,7 @@ 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/util/DoubleEnumeration.java \
java/lang/ref/PhantomReference.java \
java/lang/ref/Reference.java \
java/lang/ref/ReferenceQueue.java \
......@@ -1241,6 +1241,7 @@ 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
......@@ -1388,7 +1389,8 @@ java/lang/reflect/natArray.lo java/lang/reflect/natConstructor.lo \
java/lang/reflect/natField.lo java/lang/reflect/natMethod.lo \
java/net/natInetAddress.lo java/net/natPlainDatagramSocketImpl.lo \
java/net/natPlainSocketImpl.lo java/text/natCollator.lo \
java/util/zip/natDeflater.lo java/util/zip/natInflater.lo
java/util/natResourceBundle.lo java/util/zip/natDeflater.lo \
java/util/zip/natInflater.lo
libgcjx_la_OBJECTS = gnu/gcj/xlib/natClip.lo \
gnu/gcj/xlib/natColormap.lo gnu/gcj/xlib/natDisplay.lo \
gnu/gcj/xlib/natDrawable.lo gnu/gcj/xlib/natFont.lo \
......@@ -1493,8 +1495,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/gcj/text/LocaleData_en.P \
.deps/gnu/gcj/text/LocaleData_en_US.P \
.deps/gnu/gcj/text/SentenceBreakIterator.P \
.deps/gnu/gcj/text/WordBreakIterator.P \
.deps/gnu/gcj/util/EnumerationChain.P .deps/gnu/gcj/xlib/Clip.P \
.deps/gnu/gcj/text/WordBreakIterator.P .deps/gnu/gcj/xlib/Clip.P \
.deps/gnu/gcj/xlib/Colormap.P .deps/gnu/gcj/xlib/Display.P \
.deps/gnu/gcj/xlib/Drawable.P .deps/gnu/gcj/xlib/Font.P \
.deps/gnu/gcj/xlib/GC.P .deps/gnu/gcj/xlib/Pixmap.P \
......@@ -1560,7 +1561,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/security/provider/DefaultPolicy.P \
.deps/gnu/java/security/provider/Gnu.P \
.deps/gnu/java/security/provider/SHA.P \
.deps/gnu/java/security/provider/SHA1PRNG.P .deps/interpret.P \
.deps/gnu/java/security/provider/SHA1PRNG.P \
.deps/gnu/java/util/DoubleEnumeration.P .deps/interpret.P \
.deps/java/applet/Applet.P .deps/java/applet/AppletContext.P \
.deps/java/applet/AppletStub.P .deps/java/applet/AudioClip.P \
.deps/java/awt/AWTError.P .deps/java/awt/AWTEvent.P \
......@@ -2062,8 +2064,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.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/zip/Adler32.P .deps/java/util/zip/CRC32.P \
.deps/java/util/zip/CheckedInputStream.P \
.deps/java/util/natResourceBundle.P .deps/java/util/zip/Adler32.P \
.deps/java/util/zip/CRC32.P .deps/java/util/zip/CheckedInputStream.P \
.deps/java/util/zip/CheckedOutputStream.P \
.deps/java/util/zip/Checksum.P \
.deps/java/util/zip/DataFormatException.P \
......
/* Copyright (C) 1999 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package gnu.gcj.util;
import java.util.Enumeration;
import java.util.NoSuchElementException;
public class EnumerationChain implements Enumeration
{
private Enumeration first_;
private Enumeration second_;
public EnumerationChain (Enumeration first, Enumeration second)
{
if (first == null
|| second == null)
throw new NullPointerException();
first_ = first;
second_ = second;
}
public synchronized boolean hasMoreElements()
{
if (first_ == null)
return false;
else
return first_.hasMoreElements();
}
public synchronized Object nextElement() throws NoSuchElementException
{
while (first_ != null)
{
if (! first_.hasMoreElements())
{
first_ = second_;
second_ = null;
}
else
return first_.nextElement();
}
throw new NoSuchElementException();
}
}
/* gnu.java.util.DoubleEnumeration
Copyright (C) 1998, 1999, 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 gnu.java.util;
import java.io.*;
import java.util.Enumeration;
import java.util.NoSuchElementException;
/**
* This is a helper class that combines two Enumerations.
* It returns the elements of the first Enumeration until it has
* no more elements and then returns the elements of the second
* Enumeration.<br>
*
* In the default case:
* <pre>
* doubleEnum = new DoubleEnumeration(enum1, enum2);
* while (doubleEnum.hasMoreElements()) {
* Object o = doubleEnum.nextElement();
* do_something(o);
* }
* </pre>
* it calls hasMoreElements of the Enumerations as few times as
* possible.
* The references to the Enumerations are cleared as soon as they have no
* more elements to help garbage collecting.
*
* @author Jochen Hoenicke
* @author Mark Wielaard (mark@klomp.org)
*/
public class DoubleEnumeration implements Enumeration
{
/**
* This is true as long as one of the enumerations has more
* elements.
* Only valid when hasChecked is true.
* Set in <code>hasMoreElements()</code>
*/
private boolean hasMore;
/**
* This is true, if it is sure that hasMore indicates wether there are
* more elements.
* Set to true in <code>hasMoreElements()</code>.
* Set to false in <code>getNextElement()</code>.
*/
private boolean hasChecked;
/**
* The first enumeration.
*/
private Enumeration e1;
/**
* The second enumeration.
*/
private Enumeration e2;
/**
* Creates a new Enumeration combining the given two enumerations.
* The enumerations mustn't be accessed by other classes.
*/
public DoubleEnumeration(Enumeration e1, Enumeration e2)
{
this.e1 = e1;
this.e2 = e2;
hasChecked = false;
}
/**
* Returns true, if at least one of the two enumerations has more
* elements.
*/
public boolean hasMoreElements()
{
if (hasChecked)
return hasMore;
hasMore = (e1 != null && e1.hasMoreElements());
if (!hasMore) {
e1 = e2;
e2 = null;
hasMore = (e1 != null && e1.hasMoreElements());
}
hasChecked = true;
return hasMore;
}
/**
* Returns the next element. This returns the next element of the
* first enumeration, if it has more elements, otherwise the next
* element of the second enumeration. If both enumeration don't have
* any elements it throws a <code>NoSuchElementException</code>.
*/
public Object nextElement()
{
if (!hasMoreElements())
throw new NoSuchElementException();
else {
hasChecked = false;
return e1.nextElement();
}
}
}
/*
* java.beans.VetoableChangeSupport: part of the Java Class Libraries project.
* Copyright (C) 1998, 2000 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* java.beans.VetoableChangeSupport
Copyright (C) 1998 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.beans;
import java.util.Hashtable;
......
/* Copyright (C) 1998, 1999 Free Software Foundation
/* ConcurrentModificationException.java -- Data structure concurrently modified
Copyright (C) 1998, 1999, 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. */
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.util;
/**
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
*/
/* Added in JDK 1.2 */
/**
* Exception that is thrown by the collections classes when it is detected that
* a modification has been made to a data structure when this is not allowed,
* such as when a collection is structurally modified while an Iterator is
* operating over it. In cases where this can be detected, a
* ConcurrentModificationException will be thrown. An Iterator that detects this
* condition is referred to as fail-fast.
*
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
* @since 1.2
*/
public class ConcurrentModificationException extends RuntimeException
{
private static final long serialVersionUID = -3666751008965953603L;
/**
* Constructs a ConcurrentModificationException with no detail message.
*/
public ConcurrentModificationException()
{
super();
}
public ConcurrentModificationException(String msg)
/**
* Constructs a ConcurrentModificationException with a detail message.
*
* @param detail the detail message for the exception
*/
public ConcurrentModificationException(String detail)
{
super(msg);
super(detail);
}
}
/* Copyright (C) 1998, 1999 Free Software Foundation
/* EmptyStackException.java -- Attempt to pop from an empty stack
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of libgcj.
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. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.util;
/**
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
*/
/**
* This exception is thrown by the Stack class when an attempt is made to pop
* or otherwise access elements from an empty stack.
*
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
public class EmptyStackException extends RuntimeException
{
private static final long serialVersionUID = 5084686378493302095L;
/**
* Constructs an EmptyStackException with no detail message.
*/
public EmptyStackException()
{
super();
......
/* Copyright (C) 1998, 1999 Free Software Foundation
/* java.util.ListResourceBundle
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of libgcj.
This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
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.
package java.util;
/**
* @author Anthony Green <green@cygnus.com>
* @date November 26, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3,
* and "The Java Language Specification", ISBN 0-201-63451-1. */
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.
public abstract class ListResourceBundle extends ResourceBundle
{
public final Object handleGetObject(String key)
{
Object a[][] = getContents();
for (int i = 0; i < a.length; i++)
{
if (key.compareTo((String) a[i][0]) == 0)
return a[i][1];
}
throw new MissingResourceException("can't find handle",
getClass().getName(),
key);
}
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.
public Enumeration getKeys()
{
Object a[][] = getContents();
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. */
Vector keys = new Vector(a.length);
for (int i = 0; i < a.length; i++)
keys.addElement(a[i][0]);
package java.util;
return keys.elements();
}
/**
* A <code>ListResouceBundle</code> provides an easy way, to create
* your own resource bundle. It is an abstract class that you can
* subclass. You should then overwrite the getContents method, that
* provides a key/value list.
* <br>
* The key/value list is a two dimensional list of Object. The first
* dimension ranges over the resources. The second dimension ranges
* from zero (key) to one (value). The keys must be of type String.
* <br>
* XXX Example!
*
* @see Locale
* @see PropertyResourceBundle
* @author Jochen Hoenicke */
public abstract class ListResourceBundle extends ResourceBundle
{
/**
* The constructor. It does nothing special.
*/
public ListResourceBundle()
{
}
/**
* Gets the key/value list. You must override this method.
* @return a two dimensional list of Objects. The first dimension
* ranges over the objects, and the second dimension ranges from
* zero (key) to one (value).
*/
protected abstract Object[][] getContents();
public ListResourceBundle()
/**
* Override this method to provide the resource for a keys. This gets
* called by <code>getObject</code>.
* @param key The key of the resource.
* @return The resource for the key or null if it doesn't exists.
*/
protected Object handleGetObject(String key)
{
Object[][] contents = getContents();
for (int i = 0; i < contents.length; i++)
{
if (key.equals(contents[i][0]))
return contents[i][1];
}
return null;
}
/**
* This method should return all keys for which a resource exists.
* @return An enumeration of the keys.
*/
public Enumeration getKeys()
{
final Object[][] contents = getContents();
return new Enumeration()
{
}
int i = 0;
public boolean hasMoreElements()
{
return i < contents.length;
}
public Object nextElement()
{
return contents[i++][0];
}
};
}
}
/* Copyright (C) 1998, 1999 Free Software Foundation
/* java.util.MissingResourceException
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of libgcj.
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. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.util;
/**
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
*/
/**
* This exception is thrown when a resource is missing.
*
* @see ResourceBundle
* @author Jochen Hoenicke
* @author Warren Levy <warrenl@cygnus.com>
*/
public class MissingResourceException extends RuntimeException
{
private static final long serialVersionUID = -4876345176062000401L;
/**
* The name of the resource bundle requested by user.
*/
private String className;
/**
* The key of the resource in the bundle requested by user.
*/
private String key;
public MissingResourceException(String msg, String cName, String k)
/**
* Creates a new exception, with the specified parameters.
* @param s the detail message.
* @param className the name of the resource bundle.
* @param key the key of the missing resource.
*/
public MissingResourceException(String s, String className, String key)
{
super(msg);
className = cName;
key = k;
super(s);
this.className = className;
this.key = key;
}
/**
* Gets the name of the resource bundle, for which a resource is missing.
* @return the name of the resource bundle.
*/
public String getClassName()
{
return className;
}
/**
* Gets the key of the resource that is missing bundle, this is an empty
* string if the whole resource bundle is missing.
* @return the name of the resource bundle.
*/
public String getKey()
{
return key;
}
}
/* Copyright (C) 1998, 1999 Free Software Foundation
/* NoSuchElementException.java -- Attempt to access element that does not exist
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of libgcj.
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. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.util;
/**
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
*/
/**
* Exception thrown when an attempt is made to access an element that does not
* exist. This exception is thrown by the Enumeration, Iterator and ListIterator
* classes if the nextElement, next or previous method goes beyond the end of
* the list of elements that are being accessed.
*
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
public class NoSuchElementException extends RuntimeException
{
private static final long serialVersionUID = 6769829250639411880L;
/**
* Constructs a NoSuchElementException with no detail message.
*/
public NoSuchElementException()
{
super();
}
public NoSuchElementException(String msg)
/**
* Constructs a NoSuchElementException with a detail message.
*
* @param detail the detail message for the exception
*/
public NoSuchElementException(String detail)
{
super(msg);
super(detail);
}
}
/* Copyright (C) 1999 Free Software Foundation
/* java.util.PropertyResourceBundle
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of libgcj.
This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
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.
package java.util;
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.
import java.io.InputStream;
import java.io.IOException;
import gnu.gcj.util.EnumerationChain;
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.
/**
* @author Anthony Green <green@cygnus.com>
* @date April 29, 1999.
*/
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. */
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3,
* and "The Java Language Specification", ISBN 0-201-63451-1. */
package java.util;
import gnu.java.util.DoubleEnumeration;
/**
* This class is a concrete <code>ResourceBundle</code> that gets it
* resources from a property file. This implies that the resources are
* strings. For more information about resource bundles see the class
* <code>ResourceBundle</code>.
*
* You should not use this class directly, or subclass it, but you get
* an object of this class automatically when you call
* <code>ResourceBundle.getBundle()</code> and there is a properties
* file.
*
* If there is also a class for this resource and the same locale, the
* class does win.
*
* The properties file should have the name of the resource bundle,
* appended with the locale (e.g. <code>_de</code) and the extension
* <code>.properties</code>. The file should have the same format
* as for <code>Properties.load()</code>
*
* XXX- move this to properties.
* The file should have the following
* format: An empty line or a line starting with <code>#</code> is
* ignored. An backslash (<code>\</code>) at the end of the line
* makes the line continueing on the next line. Otherwise, each line
* describes a key/value pair. The chars up to the first whitespace,
* = or : are the key. The key is followed by one or more
* whitespaces, <code>=</code> or <code>:</code>. The rest of the
* line is the resource belonging to the key. You can give unicode
* characters with the <code>\\uxxxx</code> notation, where
* <code>xxxx</code> is the hex encoding of the 16 bit unicode char
* number.
*
* An example of a properties file for the german language is given
* here. This extends the example given in ListResourceBundle.
* Create a file MyResource_de.properties with the following contents
* and put it in the CLASSPATH. (The char <code>\u00e4<char> is the
* german &auml;)
*
* <pre>
* s1=3
* s2=MeineDisk
* s3=3. M\u00e4rz 96
* s4=Die Diskette ''{1}'' enth\u00e4lt {0} in {2}.
* s5=0
* s6=keine Dateien
* s7=1
* s8=eine Datei
* s9=2
* s10={0,number} Dateien
* s11=Die Formatierung warf eine Exception: {0}
* s12=FEHLER
* s13=Ergebnis
* s14=Dialog
* s15=Auswahlkriterium
* s16=1,3
* </pre>
*
* @see ResourceBundle
* @see ListResourceBundle
* @see Properties#load()
* @author Jochen Hoenicke */
public class PropertyResourceBundle extends ResourceBundle
{
private Properties properties;
Properties properties;
/**
* Creates a new property resource bundle.
* @param stream An input stream, where the resources are read from.
*/
public PropertyResourceBundle(java.io.InputStream stream)
throws java.io.IOException
{
properties = new Properties();
properties.load(stream);
}
public PropertyResourceBundle (InputStream pstream) throws IOException
{
// Initialize and load our Properties.
properties = new Properties();
properties.load(pstream);
}
/**
* Called by <code>getObject</code> when a resource is needed. This
* returns the resource given by the key.
* @param key The key of the resource.
* @return The resource for the key or null if it doesn't exists.
*/
protected Object handleGetObject(String key)
{
return properties.getProperty(key);
}
/**
* This method should return all keys for which a resource exists.
* @return An enumeration of the keys.
*/
public Enumeration getKeys()
{
if (parent == null)
return properties.propertyNames();
else
return new EnumerationChain (properties.propertyNames(),
parent.getKeys ());
}
public Object handleGetObject (String key)
{
return properties.getProperty(key);
}
}
{
// We must also return the keys of our parent.
if (parent != null)
{
return new DoubleEnumeration(properties.propertyNames(),
parent.getKeys());
}
return properties.propertyNames();
}
}
/* Copyright (C) 1998, 1999 Free Software Foundation
/* java.util.TooManyListenersException
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of libgcj.
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. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package java.util;
/**
* @author Warren Levy <warrenl@cygnus.com>
* @date September 2, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
* Status: Believed complete and correct.
*/
/**
* This exception is part of the java event model. It is thrown if an
* event listener is added via the addXyzEventListener method, but the
* object doesn't support any more listeners, e.g. it only supports a
* single event listener.
*
* @see EventListener
* @see EventObject
* @author Jochen Hoenicke
* @author Warren Levy <warrenl@cygnus.com>
*/
public class TooManyListenersException extends Exception
{
private static final long serialVersionUID = 5074640544770687831L;
/**
* Constructs a TooManyListenersException with no detail message.
*/
public TooManyListenersException()
{
super();
}
public TooManyListenersException(String msg)
/**
* Constructs a TooManyListenersException with a detail message.
* @param detail the detail message.
*/
public TooManyListenersException(String detail)
{
super(msg);
super(detail);
}
}
// natResourceBundle.cc - Native code for ResourceBundle class.
/* Copyright (C) 2001 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <gcj/cni.h>
#include <jvm.h>
#include <java/util/ResourceBundle.h>
#include <java/lang/Class.h>
#include <java/lang/ClassLoader.h>
JArray<jclass> *
java::util::ResourceBundle::getClassContext ()
{
// FIXME: we currently lack the capability to correctly implement
// this method. So we fake it by telling ResourceBundle that we
// only have the system class loader.
jobjectArray a = JvNewObjectArray (2, &java::lang::Class::class$, NULL);
jobject *elts = elements (a);
elts[0] = java::lang::ClassLoader::getSystemClassLoader ();
elts[1] = elts[0];
return reinterpret_cast< JArray<jclass> *> (a);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment