summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Berry <gcb@gnu.org>1998-07-24 22:56:35 +0000
committerGeoff Berry <gcb@gnu.org>1998-07-24 22:56:35 +0000
commit13304cb8a4657f6a30bc88eaa19de723885ca72e (patch)
treee7fb8543aa78ed5d5b82d2bf3cd9988cf0241641
parent849b6c86eefcf6c4e66e2af460a5e0421ea4575e (diff)
downloadclasspath-13304cb8a4657f6a30bc88eaa19de723885ca72e.tar.gz
Added java.lang.Comparable, java.lang.UnsupportedOperationException
and some Makefile.am's in an attempt to get the entire tree to compile.
-rw-r--r--java/lang/Comparable.java42
-rw-r--r--java/lang/Makefile.am3
-rw-r--r--java/lang/UnsupportedOperationException.java35
-rw-r--r--java/lang/reflect/Makefile.am6
-rw-r--r--java/math/Makefile.am7
-rw-r--r--java/net/Makefile.am19
-rw-r--r--test/java.lang.reflect/Makefile.am5
-rw-r--r--test/java.util/Makefile.am5
8 files changed, 103 insertions, 19 deletions
diff --git a/java/lang/Comparable.java b/java/lang/Comparable.java
new file mode 100644
index 000000000..07a26210c
--- /dev/null
+++ b/java/lang/Comparable.java
@@ -0,0 +1,42 @@
+/*************************************************************************
+/* Comparable.java -- Interface for comparaing objects to obtain an ordering
+/*
+/* Copyright (c) 1998 by Geoffrey C. Berry (gcb@cs.duke.edu)
+/*
+/* This program 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, version 2. (see COPYING.LIB)
+/*
+/* This program 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 this program; if not, write to the Free Software Foundation
+/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA
+/*************************************************************************/
+
+package java.lang;
+
+/**
+ 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.
+
+ @see java.util.Comparator
+*/
+public interface Comparable
+{
+ /**
+ @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>
+ */
+ public int compareTo( Object o );
+}
diff --git a/java/lang/Makefile.am b/java/lang/Makefile.am
index 6c8427e67..6575be10b 100644
--- a/java/lang/Makefile.am
+++ b/java/lang/Makefile.am
@@ -2,5 +2,4 @@
javalangdir = $(datadir)/java/lang
-javalang_JAVA = Boolean.java Byte.java Cloneable.java Compiler.java Comparable.java Integer.java Long.java Number.java Runnable.java Short.java String.java StringBuffer.java Void.java
-
+javalang_JAVA = Boolean.java Byte.java Cloneable.java Compiler.java Comparable.java Integer.java Long.java Number.java Runnable.java Short.java String.java StringBuffer.java UnsupportedOperationException.java Void.java
diff --git a/java/lang/UnsupportedOperationException.java b/java/lang/UnsupportedOperationException.java
new file mode 100644
index 000000000..e9f79bd21
--- /dev/null
+++ b/java/lang/UnsupportedOperationException.java
@@ -0,0 +1,35 @@
+/*************************************************************************
+/* UnsupportedOperationException.java -- Exception thrown when an
+/* unsupported operation is attempted on an object
+/*
+/* Copyright (c) 1998 by Geoffrey C. Berry (gcb@cs.duke.edu)
+/*
+/* This program 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, version 2. (see COPYING.LIB)
+/*
+/* This program 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 this program; if not, write to the Free Software Foundation
+/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA
+/*************************************************************************/
+
+package java.lang;
+
+/**
+ This exception is thrown by an object when an operation is
+ requested of it that it does not support.
+*/
+public class UnsupportedOperationException extends RuntimeException
+{
+ public UnsupportedOperationException() {}
+
+ public UnsupportedOperationException( String msg )
+ {
+ super( msg );
+ }
+}
diff --git a/java/lang/reflect/Makefile.am b/java/lang/reflect/Makefile.am
new file mode 100644
index 000000000..35622f480
--- /dev/null
+++ b/java/lang/reflect/Makefile.am
@@ -0,0 +1,6 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+javalangreflectdir = $(datadir)/java/lang/reflect
+
+javalangreflect_JAVA = Array.java Constructor.java Field.java InvocationTargetException.java Member.java Method.java Modifier.java
+
diff --git a/java/math/Makefile.am b/java/math/Makefile.am
new file mode 100644
index 000000000..914ea4ca8
--- /dev/null
+++ b/java/math/Makefile.am
@@ -0,0 +1,7 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+javamathdir = $(datadir)/java/math
+
+javamath_JAVA = BigInteger.java
+
+
diff --git a/java/net/Makefile.am b/java/net/Makefile.am
index ac7e42ae2..df72ff65e 100644
--- a/java/net/Makefile.am
+++ b/java/net/Makefile.am
@@ -2,22 +2,7 @@
javanetdir = $(datadir)/java/net
-javanet_JAVA = BindException.java ConnectException.java ContentHandler.java \
- ContentHandlerFactory.java DatagramPacket.java \
- DatagramSocket.java DatagramSocketImpl.java FileNameMap.java \
- HttpURLConnection.java InetAddress.java \
- MalformedURLException.java \
- MimeTypeMapper.java MulticastSocket.java \
- NoRouteToHostException.java PasswordAuthentication.java \
- PlainDatagramSocketImpl.java PlainSocketImpl.java \
- ProtocolException.java ServerSocket.java Socket.java \
- SocketException.java SocketImpl.java SocketImplFactory.java \
- SocketInputStream.java SocketOptions.java \
- SocketOutputStream.java URL.java URLConnection.java \
- URLEncoder.java URLStreamHandler.java \
- URLStreamHandlerFactory.java UnknownHostException.java \
- UnknownServiceException.java
+javanet_JAVA = BindException.java ConnectException.java ContentHandler.java ContentHandlerFactory.java DatagramPacket.java DatagramSocket.java DatagramSocketImpl.java FileNameMap.java HttpURLConnection.java InetAddress.java MalformedURLException.java MimeTypeMapper.java MulticastSocket.java NoRouteToHostException.java PasswordAuthentication.java PlainDatagramSocketImpl.java PlainSocketImpl.java ProtocolException.java ServerSocket.java Socket.java SocketException.java SocketImpl.java SocketImplFactory.java SocketInputStream.java SocketOptions.java SocketOutputStream.java URL.java URLConnection.java URLEncoder.java URLStreamHandler.java URLStreamHandlerFactory.java UnknownHostException.java UnknownServiceException.java
-EXTRA_DIST = Authenticator.java JarURLConnection.java NetPermission.java \
- SocketPermission.java STATUS TODO
+EXTRA_DIST = Authenticator.java JarURLConnection.java NetPermission.java SocketPermission.java STATUS TODO
diff --git a/test/java.lang.reflect/Makefile.am b/test/java.lang.reflect/Makefile.am
new file mode 100644
index 000000000..79106a822
--- /dev/null
+++ b/test/java.lang.reflect/Makefile.am
@@ -0,0 +1,5 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+check_JAVA = ArrayTest.java
+
+
diff --git a/test/java.util/Makefile.am b/test/java.util/Makefile.am
new file mode 100644
index 000000000..abb50f7da
--- /dev/null
+++ b/test/java.util/Makefile.am
@@ -0,0 +1,5 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+check_JAVA = ArraysTest.java
+
+