diff options
author | Mark Wielaard <mark@klomp.org> | 2001-09-30 18:04:38 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2001-09-30 18:04:38 +0000 |
commit | cfcdbe54802c69a7d731d8e1f48b858fe73a4452 (patch) | |
tree | 2cec7bc9d47b85121f85787a13c11ecc61e48402 /libjava/java/lang | |
parent | c9b9c05cc1242181a04df16d7db71c885fbc54f5 (diff) | |
download | gcc-cfcdbe54802c69a7d731d8e1f48b858fe73a4452.zip gcc-cfcdbe54802c69a7d731d8e1f48b858fe73a4452.tar.gz gcc-cfcdbe54802c69a7d731d8e1f48b858fe73a4452.tar.bz2 |
DataInput.java: Merge with Classpath.
* java/io/DataInput.java: Merge with Classpath.
* java/io/DataOutput.java: Idem.
* java/io/FilenameFilter.java: Idem.
* java/io/Serializable.java: Idem.
* java/lang/Cloneable.java: Idem.
* java/lang/Comparable.java: Idem.
* java/lang/Runnable.java: Idem.
* java/lang/reflect/Member.java: Idem.
* java/net/ContentHandlerFactory.java: Idem.
* java/net/FileNameMap.java: Idem.
* java/net/SocketImplFactory.java: Idem.
* java/net/SocketOptions.java: Idem.
* java/net/URLStreamHandlerFactory.java: Idem.
From-SVN: r45910
Diffstat (limited to 'libjava/java/lang')
-rw-r--r-- | libjava/java/lang/Cloneable.java | 75 | ||||
-rw-r--r-- | libjava/java/lang/Comparable.java | 60 | ||||
-rw-r--r-- | libjava/java/lang/Runnable.java | 51 | ||||
-rw-r--r-- | libjava/java/lang/reflect/Member.java | 87 |
4 files changed, 222 insertions, 51 deletions
diff --git a/libjava/java/lang/Cloneable.java b/libjava/java/lang/Cloneable.java index 404bff9..1524409 100644 --- a/libjava/java/lang/Cloneable.java +++ b/libjava/java/lang/Cloneable.java @@ -1,23 +1,76 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Cloneable.java -- Interface for marking objects cloneable by Object.clone() + Copyright (C) 1998, 1999, 2001 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. +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.lang; - -/** - * @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 interface should be implemented by classes wishing to + * support of override <code>Object.clone()</code>. The default + * behaviour of <code>clone()</code> performs a shallow copy, but + * subclasses often change this to perform a deep copy. Therefore, + * it is a good idea to document how deep your clone will go. + * If <code>clone()</code> is called on an object which does not + * implement this interface, a <code>CloneNotSupportedException</code> + * will be thrown. + * <p> + * + * This interface is simply a tagging interface; it carries no + * requirements on methods to implement. However, it is typical for + * a Cloneable class to implement at least <code>equals</code>, + * <code>hashCode</code>, and <code>clone</code>, sometimes + * increasing the accessibility of clone to be public. The typical + * implementation of <code>clone</code> invokes <code>super.clone()</code> + * rather than a constructor, but this is not a requirement. + * <p> + * + * If an object that implement Cloneable should not be cloned, + * simply override the <code>clone</code> method to throw a + * <code>CloneNotSupportedException</code>. + * <p> + * + * All array types implement Cloneable, and have a public + * <code>clone</code> method that will never fail with a + * <code>CloneNotSupportedException</code>. + * + * @since 1.0 + * @author Paul Fisher + * @author Eric Blake <ebb9@email.byu.edu> + * @author Warren Levy <warrenl@cygnus.com> + * + * @see Object#clone() + * @see CloneNotSupportedException + */ public interface Cloneable { + // Tagging interface only. } diff --git a/libjava/java/lang/Comparable.java b/libjava/java/lang/Comparable.java index d153d10..734abc4 100644 --- a/libjava/java/lang/Comparable.java +++ b/libjava/java/lang/Comparable.java @@ -1,22 +1,58 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Comparable.java -- Interface for comparaing objects to obtain an ordering + Copyright (C) 1998, 1999, 2001 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. +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.lang; - -/** - * @author Warren Levy <warrenl@cygnus.com> - * @date September 8, 1998. - */ + /* Written using online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Interface for objects that can be ordering among other + * 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. + * + * @author Geoff Berry + * @author Warren Levy <warrenl@cygnus.com> + * + * @since JDK1.2 + * @see java.util.Comparator + */ public interface Comparable { - public int compareTo(Object o) throws ClassCastException; + /** + * @return a negative integer if this object is less than + * <code>o<code>, zero if this object is equal to <code>o</code>, or + * a positive integer if this object is greater than <code>o</code> + */ + int compareTo( Object o ); } diff --git a/libjava/java/lang/Runnable.java b/libjava/java/lang/Runnable.java index a5eed31..3d424e2 100644 --- a/libjava/java/lang/Runnable.java +++ b/libjava/java/lang/Runnable.java @@ -1,19 +1,31 @@ -// Runnable.java - Runnable interface. +/* java.lang.Runnable + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. -package java.lang; +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. */ -/** - * @author Tom Tromey <tromey@cygnus.com> - * @date August 25, 1998 - */ + +package java.lang; /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 @@ -21,7 +33,22 @@ package java.lang; * Status: Complete. */ +/** + * Runnable is an interface you implement to indicate that your class can be + * executed as the main part of a Thread, among other places. When you want + * an entry point to run a piece of code, implement this interface and + * override run. + * + * @author Paul Fisher + * @author Tom Tromey <tromey@cygnus.com> + */ + public interface Runnable { - public abstract void run (); + /** + * This method will be called by whoever wishes to run your class + * implementing Runnable. + * @since JDK1.0 + */ + void run(); } diff --git a/libjava/java/lang/reflect/Member.java b/libjava/java/lang/reflect/Member.java index 43b14ac..d76cdda 100644 --- a/libjava/java/lang/reflect/Member.java +++ b/libjava/java/lang/reflect/Member.java @@ -1,26 +1,81 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* java.lang.reflect.Member + 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.lang.reflect; -/** - * @author Per Bothner <bothner@cygnus.com> - * @date September 27, 1998. - */ /* Written using "Java Class Libraries", 2nd edition. * Status: Believed complete and correct. */ -public interface Member -{ - public static final int PUBLIC = 0; - public static final int DECLARED = 1; - public Class getDeclaringClass (); - public int getModifiers (); - public String getName(); +/** + * Member is an interface that represents any member of a class. + * i.e. a field, a method or a constructor. + * You can get information about the declaring class, name or modifiers of + * the member with this interface. + * + * @author John Keiser + * @author Per Bothner <bothner@cygnus.com> + */ +public interface Member { + /** + * Represents all members, whether public, private, protected or + * package-protected. + * Used in java.lang.SecurityManager.checkMemberAccess() to determine the + * type of members to access. + */ + static final int DECLARED = 1; + + /** + * Represents public members only. Used inr + * java.lang.SecurityManager.checkMemberAccess() to determine the type of + * members to access. + */ + static final int PUBLIC = 0; + + /** + * Gets the class that declared this member. + * <STRONG>It is unclear whether this returns the class that actually + * syntactically declared the member, or the class where the + * <code>Member</code> object was gotten from.</STRONG> + * @return the class that declared this member. + */ + Class getDeclaringClass(); + + /** + * Gets the modifiers this member uses. Use the <code>Modifier</code> + * class to interpret the values. + * @see Modifier + * @return an integer representing the modifiers to this Member. + */ + int getModifiers(); + + /** + * Gets the name of this member. + * @return the name of this member. + */ + String getName(); } |