You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2005/12/01 07:04:00 UTC
svn commit: r350181 [102/198] - in
/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core: ./ depends/
depends/files/ depends/jars/ depends/libs/ depends/libs/linux.IA32/
depends/libs/win.IA32/ depends/oss/ depends/oss/linux.IA32/
depends/oss/win....
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/SyncFailedException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/SyncFailedException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/SyncFailedException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/SyncFailedException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,38 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.io;
+
+
+/**
+ * This IO exception is thrown when the method <code>sync()</code> in
+ * FileDescriptor failed to complete.
+ *
+ * @see FileDescriptor#sync()
+ */
+public class SyncFailedException extends IOException {
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * the detail message for the exception.
+ */
+ public SyncFailedException(String detailMessage) {
+ super(detailMessage);
+ }
+
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UTFDataFormatException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UTFDataFormatException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UTFDataFormatException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UTFDataFormatException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,45 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.io;
+
+
+/**
+ * This IO exception is thrown when a program attempts to read a UTF-8 String
+ * and the encoding is incorrect.
+ *
+ * @see DataInputStream#readUTF()
+ */
+public class UTFDataFormatException extends IOException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public UTFDataFormatException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * the detail message for the exception.
+ */
+ public UTFDataFormatException(String detailMessage) {
+ super(detailMessage);
+ }
+
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UnsupportedEncodingException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UnsupportedEncodingException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UnsupportedEncodingException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/UnsupportedEncodingException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,43 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.io;
+
+/**
+ * This IO exception is thrown when a program asks for a particular character
+ * converter and it is not available.
+ *
+ */
+public class UnsupportedEncodingException extends IOException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public UnsupportedEncodingException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * the detail message for the exception.
+ */
+ public UnsupportedEncodingException(String detailMessage) {
+ super(detailMessage);
+ }
+
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/WriteAbortedException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/WriteAbortedException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/WriteAbortedException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/WriteAbortedException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,78 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.io;
+
+
+/**
+ * This type of exception is thrown by readObject() when it detects an exception
+ * marker in the input stream. This marker indicates that when the object was
+ * being serialized, an exception happened and this marker was inserted instead
+ * of the original object. It is a way to "propagate" an exception from the code
+ * that attempted to write the object to the code that is attempting to read the
+ * object.
+ *
+ * @see ObjectInputStream#readObject()
+ */
+public class WriteAbortedException extends ObjectStreamException {
+
+ static final long serialVersionUID = -3326426625597282442L;
+
+ /**
+ * The exception that was caused when writeObject() was attempting to
+ * serialize the object
+ */
+ public Exception detail;
+
+ /**
+ * Constructs a new instance of this class with its walkback, message and
+ * the exception which caused the underlying problem when serializing the
+ * object filled in.
+ *
+ * @param detailMessage
+ * the detail message for the exception.
+ * @param rootCause
+ * exception that caused the problem when serializing the object.
+ */
+ public WriteAbortedException(String detailMessage, Exception rootCause) {
+ super(detailMessage);
+ detail = rootCause;
+ initCause(rootCause);
+ }
+
+ /**
+ * Answers the extra information message which was provided when the
+ * throwable was created. If no message was provided at creation time, then
+ * answer null.
+ *
+ * @return the receiver's message.
+ */
+ public String getMessage() {
+ String msg = super.getMessage();
+ if (detail != null) {
+ msg = msg + "; " + detail.toString(); //$NON-NLS-1$
+ }
+ return msg;
+ }
+
+ /**
+ * Answers the cause of this Throwable, or null if there is no cause.
+ *
+ * @return the receiver's cause.
+ */
+ public Throwable getCause() {
+ return detail;
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/Writer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/Writer.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/Writer.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/io/Writer.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,165 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.io;
+
+
+/**
+ * Writer is an Abstract class for writing Character Streams. Subclasses of
+ * writer must implement the methods <code>write(char[], int, int)</code>,
+ * <code>close()</code> and <code>flush()</code>.
+ *
+ * @see Reader
+ */
+public abstract class Writer {
+ /** The object used to syncronize access to the writer. */
+ protected Object lock;
+
+ /**
+ * Constructs a new character stream Writer using <code>this</code> as the
+ * Object to synchronize critical regions around.
+ *
+ */
+ protected Writer() {
+ super();
+ lock = this;
+ }
+
+ /**
+ * Constructs a new character stream Writer using <code>lock</code> as the
+ * Object to synchronize critical regions around.
+ *
+ * @param lock
+ * the Object to synchronize critical regions around.
+ */
+ protected Writer(Object lock) {
+ if (lock != null)
+ this.lock = lock;
+ else
+ throw new NullPointerException();
+ }
+
+ /**
+ * Close this Writer. This must be implemented by any concrete subclasses.
+ * The implementation should free any resources associated with the Writer.
+ *
+ * @throws IOException
+ * If an error occurs attempting to close this Writer.
+ */
+ public abstract void close() throws IOException;
+
+ /**
+ * Flush this Writer. This must be implemented by any concrete subclasses.
+ * The implementation should ensure all buffered characters are written out.
+ *
+ * @throws IOException
+ * If an error occurs attempting to flush this Writer.
+ */
+ public abstract void flush() throws IOException;
+
+ /**
+ * Writes the entire character buffer <code>buf</code> to this Writer.
+ *
+ * @param buf
+ * the non-null array containing characters to write.
+ *
+ * @throws IOException
+ * If this Writer has already been closed or some other
+ * IOException occurs.
+ */
+ public void write(char buf[]) throws IOException {
+ write(buf, 0, buf.length);
+ }
+
+ /**
+ * Writes <code>count</code> characters starting at <code>offset<code> in
+ * <code>buf</code> to this Writer. This abstract method must be implemented
+ * by concrete subclasses.
+ *
+ * @param buf the non-null array containing characters to write.
+ * @param offset offset in buf to retrieve characters
+ * @param count maximum number of characters to write
+ *
+ * @throws IOException If this Writer has already been closed or some other IOException occurs.
+ * @throws ArrayIndexOutOfBoundsException If offset or count are outside of bounds.
+ */
+ public abstract void write(char buf[], int offset, int count)
+ throws IOException;
+
+ /**
+ * Writes the specified character <code>oneChar</code> to this Writer.
+ * This implementation writes the low order two bytes of
+ * <code>oneChar</code> to the Stream.
+ *
+ * @param oneChar
+ * The character to write
+ *
+ * @throws IOException
+ * If this Writer has already been closed or some other
+ * IOException occurs.
+ */
+ public void write(int oneChar) throws IOException {
+ synchronized (lock) {
+ char oneCharArray[] = new char[1];
+ oneCharArray[0] = (char) oneChar;
+ write(oneCharArray);
+ }
+ }
+
+ /**
+ * Writes the characters from the String <code>str</code> to this Writer.
+ *
+ * @param str
+ * the non-null String containing the characters to write.
+ *
+ * @throws IOException
+ * If this Writer has already been closed or some other
+ * IOException occurs.
+ */
+ public void write(String str) throws IOException {
+ char buf[] = new char[str.length()];
+ str.getChars(0, buf.length, buf, 0);
+ write(buf);
+ }
+
+ /**
+ * Writes <code>count</code> number of characters starting at
+ * <code>offset</code> from the String <code>str</code> to this Writer.
+ *
+ * @param str
+ * the non-null String containing the characters to write.
+ * @param offset
+ * the starting point to retrieve characters.
+ * @param count
+ * the number of characters to retrieve and write.
+ *
+ * @throws IOException
+ * If this Writer has already been closed or some other
+ * IOException occurs.
+ * @throws ArrayIndexOutOfBoundsException
+ * If offset or count are outside of bounds.
+ */
+ public void write(String str, int offset, int count) throws IOException {
+ if (count >= 0) { // other cases tested by getChars()
+ char buf[] = new char[count];
+ str.getChars(offset, offset + count, buf, 0);
+
+ synchronized (lock) {
+ write(buf);
+ }
+ } else
+ throw new StringIndexOutOfBoundsException();
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AbstractMethodError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AbstractMethodError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AbstractMethodError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AbstractMethodError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,45 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when the VM notices that a an attempt is being made to
+ * invoke an abstract method.
+ * <p>
+ * Note that this can only occur when inconsistant class files are being loaded,
+ * since invoking an abstract method is a compile time error.
+ */
+public class AbstractMethodError extends IncompatibleClassChangeError {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public AbstractMethodError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public AbstractMethodError(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArithmeticException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArithmeticException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArithmeticException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArithmeticException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when the an invalid arithmetic operation is
+ * attempted.
+ */
+public class ArithmeticException extends RuntimeException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public ArithmeticException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public ArithmeticException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayIndexOutOfBoundsException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayIndexOutOfBoundsException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayIndexOutOfBoundsException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayIndexOutOfBoundsException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,56 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+import com.ibm.oti.util.Msg;
+
+/**
+ * This runtime exception is thrown when the an array is indexed with a value
+ * less than zero, or greater than or equal to the size of the array.
+ */
+public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public ArrayIndexOutOfBoundsException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * (which is based on the argument which is the index which failed) filled
+ * in.
+ *
+ * @param index
+ * int the offending index.
+ */
+ public ArrayIndexOutOfBoundsException(int index) {
+ super(Msg.getString("K0052", index));
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public ArrayIndexOutOfBoundsException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayStoreException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayStoreException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayStoreException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ArrayStoreException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when a program attempts to store into an
+ * array an element of a a type which the array can not hold..
+ */
+public class ArrayStoreException extends RuntimeException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public ArrayStoreException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public ArrayStoreException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AssertionError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AssertionError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AssertionError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/AssertionError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,111 @@
+/* Copyright 2002, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * Assert statement support
+ */
+public class AssertionError extends Error {
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public AssertionError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in.
+ *
+ * @param detailMessage
+ * Object The detail message for the exception.
+ */
+ public AssertionError(Object detailMessage) {
+ super(String.valueOf(detailMessage));
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in from
+ * the value of argument.
+ *
+ * @param detailMessage
+ * boolean Constructs the detail message from the boolean value
+ * of argument.
+ */
+ public AssertionError(boolean detailMessage) {
+ this(String.valueOf(detailMessage));
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in from
+ * the value of argument.
+ *
+ * @param detailMessage
+ * char Constructs the detail message from the char argument.
+ */
+ public AssertionError(char detailMessage) {
+ this(String.valueOf(detailMessage));
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in from
+ * the value of argument.
+ *
+ * @param detailMessage
+ * int Constructs the detail message from the value of int
+ * argument.
+ */
+ public AssertionError(int detailMessage) {
+ this(Integer.toString(detailMessage));
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in from
+ * the value of argument.
+ *
+ * @param detailMessage
+ * long Constructs the detail message from the value of long
+ * argument.
+ */
+ public AssertionError(long detailMessage) {
+ this(Long.toString(detailMessage));
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in from
+ * the value of argument.
+ *
+ * @param detailMessage
+ * float Constructs the detail message from the value of float
+ * argument.
+ */
+ public AssertionError(float detailMessage) {
+ this(Float.toString(detailMessage));
+ }
+
+ /**
+ * Constructs a new instance of this class with its message filled in from
+ * the value of argument.
+ *
+ * @param detailMessage
+ * double Constructs the detail message from the value of double
+ * argument.
+ */
+
+ public AssertionError(double detailMessage) {
+ this(Double.toString(detailMessage));
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Boolean.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Boolean.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Boolean.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Boolean.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,189 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * Booleans are objects (i.e. non-base types) which represent boolean values.
+ */
+public final class Boolean implements java.io.Serializable {
+
+ static final long serialVersionUID = -3665804199014368530L;
+
+ /**
+ * The boolean value of the receiver.
+ */
+ private final boolean value;
+
+ /**
+ * The java.lang.Class that represents this class.
+ */
+ public static final Class TYPE = new boolean[0].getClass()
+ .getComponentType();
+
+ // Note: This can't be set to "boolean.class", since *that* is
+ // defined to be "java.lang.Boolean.TYPE";
+
+ /**
+ * The instance of the receiver which represents truth.
+ */
+ public static final Boolean TRUE = new Boolean(true);
+
+ /**
+ * The instance of the receiver which represents falsehood.
+ */
+ public static final Boolean FALSE = new Boolean(false);
+
+ /**
+ * Constructs a new instance of this class given a string. If the string is
+ * equal to "true" using a non-case sensitive comparison, the result will be
+ * a Boolean representing true, otherwise it will be a Boolean representing
+ * false.
+ *
+ * @param string
+ * The name of the desired boolean.
+ */
+ public Boolean(String string) {
+ this(toBoolean(string));
+ }
+
+ /**
+ * Constructs a new instance of this class given true or false.
+ *
+ * @param value
+ * true or false.
+ */
+ public Boolean(boolean value) {
+ this.value = value;
+ }
+
+ /**
+ * Answers true if the receiver represents true and false if the receiver
+ * represents false.
+ *
+ * @return true or false.
+ */
+ public boolean booleanValue() {
+ return value;
+ }
+
+ /**
+ * Compares the argument to the receiver, and answers true if they represent
+ * the <em>same</em> object using a class specific comparison.
+ * <p>
+ * In this case, the argument must also be a Boolean, and the receiver and
+ * argument must represent the same boolean value (i.e. both true or both
+ * false).
+ *
+ * @param o
+ * the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object
+ * <code>false</code> if it is different from this object
+ *
+ * @see #hashCode
+ */
+ public boolean equals(Object o) {
+ return (o == this)
+ || ((o instanceof Boolean) && (value == ((Boolean) o).value));
+ }
+
+ /**
+ * Answers true if the system property described by the argument equal to
+ * "true" using case insensitive comparison, and false otherwise.
+ *
+ * @param string
+ * The name of the desired boolean.
+ * @return The boolean value.
+ */
+ public static boolean getBoolean(String string) {
+ if (string == null || string.length() == 0)
+ return false;
+ return (toBoolean(System.getProperty(string)));
+ }
+
+ /**
+ * Answers an integer hash code for the receiver. Any two objects which
+ * answer <code>true</code> when passed to <code>equals</code> must
+ * answer the same value for this method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+ public int hashCode() {
+ return value ? 1231 : 1237;
+ }
+
+ /**
+ * Answers true if the argument is equal to "true" using case insensitive
+ * comparison, and false otherwise.
+ *
+ * @param string
+ * The name of the desired boolean.
+ * @return the boolean value.
+ */
+ static boolean toBoolean(String string) {
+ return (string != null) && (string.toLowerCase().equals("true"));
+ }
+
+ /**
+ * Answers a string containing a concise, human-readable description of the
+ * receiver.
+ *
+ * @return a printable representation for the receiver.
+ */
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Converts the specified boolean to its string representation. When the
+ * boolean is true answer <code>"true"</code>, otherwise answer
+ * <code>"false"</code>.
+ *
+ * @param value
+ * the boolean
+ * @return the boolean converted to a string
+ */
+ public static String toString(boolean value) {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Answers a Boolean representing true if the argument is equal to "true"
+ * using case insensitive comparison, and a Boolean representing false
+ * otherwise.
+ *
+ * @param string
+ * The name of the desired boolean.
+ * @return the boolean value.
+ */
+ public static Boolean valueOf(String string) {
+ return toBoolean(string) ? Boolean.TRUE : Boolean.FALSE;
+ }
+
+ /**
+ * Answers Boolean.TRUE if the argument is equal to "true" using case
+ * insensitive comparison, and Boolean.FALSE representing false otherwise.
+ *
+ * @param b
+ * the boolean value.
+ * @return Boolean.TRUE or Boolean.FALSE Global true/false objects.
+ */
+ public static Boolean valueOf(boolean b) {
+ return b ? Boolean.TRUE : Boolean.FALSE;
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Byte.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Byte.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Byte.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Byte.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,279 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * Bytes are objects (i.e. non-base types) which represent byte values.
+ */
+public final class Byte extends Number implements Comparable {
+
+ static final long serialVersionUID = -7183698231559129828L;
+
+ /**
+ * The value which the receiver represents.
+ */
+ final byte value;
+
+ /**
+ * Most positive and most negative possible byte values.
+ */
+ public static final byte MAX_VALUE = (byte) 0x7F;
+
+ public static final byte MIN_VALUE = (byte) 0x80;
+
+ /**
+ * The java.lang.Class that represents this class.
+ */
+ public static final Class TYPE = new byte[0].getClass().getComponentType();
+
+ // Note: This can't be set to "byte.class", since *that* is
+ // defined to be "java.lang.Byte.TYPE";
+
+ /**
+ * Constructs a new instance of the receiver which represents the byte
+ * valued argument.
+ *
+ * @param value
+ * the byte to store in the new instance.
+ */
+ public Byte(byte value) {
+ this.value = value;
+ }
+
+ /**
+ * Constructs a new instance of this class given a string.
+ *
+ * @param string
+ * a string representation of a single byte quantity.
+ * @throws NumberFormatException
+ * if the argument could not be parsed as a byte quantity.
+ */
+ public Byte(String string) throws NumberFormatException {
+ this(parseByte(string));
+ }
+
+ /**
+ * Answers the byte value which the receiver represents
+ *
+ * @return byte the value of the receiver.
+ */
+ public byte byteValue() {
+ return value;
+ }
+
+ public int compareTo(Byte object) {
+ return value > object.value ? 1 : (value < object.value ? -1 : 0);
+ }
+
+ public int compareTo(Object object) {
+ return compareTo((Byte) object);
+ }
+
+ /**
+ * Parses the string argument as if it was a byte value and returns the
+ * result. It is an error if the received string does not contain a
+ * representation of a single byte quantity. The string may be a hexadecimal
+ * ("0x..."), octal ("0..."), or decimal ("...") representation of a byte.
+ *
+ * @param string
+ * a string representation of a single byte quantity.
+ * @return Byte the value represented by the argument
+ * @throws NumberFormatException
+ * if the argument could not be parsed as a byte quantity.
+ */
+ public static Byte decode(String string) throws NumberFormatException {
+ int intValue = Integer.decode(string).intValue();
+ byte result = (byte) intValue;
+ if (result == intValue)
+ return new Byte(result);
+ throw new NumberFormatException();
+ }
+
+ /**
+ * Answers the double value which the receiver represents
+ *
+ * @return double the value of the receiver.
+ */
+ public double doubleValue() {
+ return value;
+ }
+
+ /**
+ * Compares the argument to the receiver, and answers true if they represent
+ * the <em>same</em> object using a class specific comparison.
+ * <p>
+ * In this case, the argument must also be a Byte, and the receiver and
+ * argument must represent the same byte value.
+ *
+ * @param object
+ * the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object
+ * <code>false</code> if it is different from this object
+ * @see #hashCode
+ */
+ public boolean equals(Object object) {
+ return (object == this) || (object instanceof Byte)
+ && (value == ((Byte) object).value);
+ }
+
+ /**
+ * Answers the float value which the receiver represents
+ *
+ * @return float the value of the receiver.
+ */
+ public float floatValue() {
+ return value;
+ }
+
+ /**
+ * Answers an integer hash code for the receiver. Any two objects which
+ * answer <code>true</code> when passed to <code>equals</code> must
+ * answer the same value for this method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+ public int hashCode() {
+ return value;
+ }
+
+ /**
+ * Answers the int value which the receiver represents
+ *
+ * @return int the value of the receiver.
+ */
+ public int intValue() {
+ return value;
+ }
+
+ /**
+ * Answers the long value which the receiver represents
+ *
+ * @return long the value of the receiver.
+ */
+ public long longValue() {
+ return value;
+ }
+
+ /**
+ * Parses the string argument as if it was a byte value and returns the
+ * result. Throws NumberFormatException if the string does not represent a
+ * single byte quantity.
+ *
+ * @param string
+ * a string representation of a single byte quantity.
+ * @return byte the value represented by the argument
+ * @throws NumberFormatException
+ * if the argument could not be parsed as a byte quantity.
+ */
+ public static byte parseByte(String string) throws NumberFormatException {
+ int intValue = Integer.parseInt(string);
+ byte result = (byte) intValue;
+ if (result == intValue)
+ return result;
+ throw new NumberFormatException();
+ }
+
+ /**
+ * Parses the string argument as if it was a byte value and returns the
+ * result. Throws NumberFormatException if the string does not represent a
+ * single byte quantity. The second argument specifies the radix to use when
+ * parsing the value.
+ *
+ * @param string
+ * a string representation of a single byte quantity.
+ * @param radix
+ * the radix to use when parsing.
+ * @return byte the value represented by the argument
+ * @throws NumberFormatException
+ * if the argument could not be parsed as a byte quantity.
+ */
+ public static byte parseByte(String string, int radix)
+ throws NumberFormatException {
+ int intValue = Integer.parseInt(string, radix);
+ byte result = (byte) intValue;
+ if (result == intValue)
+ return result;
+ throw new NumberFormatException();
+ }
+
+ /**
+ * Answers the short value which the receiver represents
+ *
+ * @return short the value of the receiver.
+ */
+ public short shortValue() {
+ return value;
+ }
+
+ /**
+ * Answers a string containing a concise, human-readable description of the
+ * receiver.
+ *
+ * @return a printable representation for the receiver.
+ */
+ public String toString() {
+ return Integer.toString(value);
+ }
+
+ /**
+ * Answers a string containing a concise, human-readable description of the
+ * argument.
+ *
+ * @param value
+ * byte the byte to convert.
+ * @return String a printable representation for the byte.
+ */
+ public static String toString(byte value) {
+ return Integer.toString(value);
+ }
+
+ /**
+ * Parses the string argument as if it was a byte value and returns a Byte
+ * representing the result. Throws NumberFormatException if the string
+ * cannot be parsed as a byte quantity.
+ *
+ * @param string
+ * a string representation of a single byte quantity.
+ * @return Byte the value represented by the argument
+ * @throws NumberFormatException
+ * if the argument could not be parsed as a byte quantity.
+ */
+ public static Byte valueOf(String string) throws NumberFormatException {
+ return new Byte(parseByte(string));
+ }
+
+ /**
+ * Parses the string argument as if it was a byte value and returns a Byte
+ * representing the result. Throws NumberFormatException if the string
+ * cannot be parsed as a byte quantity. The second argument specifies the
+ * radix to use when parsing the value.
+ *
+ * @param string
+ * a string representation of a single byte quantity.
+ * @param radix
+ * the radix to use when parsing.
+ * @return Byte the value represented by the argument
+ * @throws NumberFormatException
+ * if the argument could not be parsed as a byte quantity.
+ */
+ public static Byte valueOf(String string, int radix)
+ throws NumberFormatException {
+ return new Byte(parseByte(string, radix));
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CharSequence.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CharSequence.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CharSequence.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CharSequence.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,64 @@
+/* Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * The CharSequence interface represets an ordered set of characters and the
+ * functions to probe them.
+ */
+public interface CharSequence {
+
+ /**
+ * Answers the number of characters in the sequence.
+ *
+ * @return the number of charcters in the sequence
+ */
+ public int length();
+
+ /**
+ * Answers the character at the specified index (0-based indexing).
+ *
+ * @param index -
+ * of the character to return
+ * @return character indicated by index
+ * @throws IndexOutOfBoundsException
+ * when <code>index < 0</code> or
+ * <code>index<\code> >= the length of the <code>CharSequence</code>
+ */
+ public char charAt(int index);
+
+ /**
+ * Answers a CharSequence from the <code>start<\code> index to the
+ * <code>end<\code> index of this sequence.
+ *
+ * @param start -- index of the start of the sub-sequence to return
+ * @param end -- index of the end of the sub-sequence to return
+ * @return the sub sequence from start to end
+ * @throws IndexOutOfBoundsException when 1. either index is below 0
+ * 2. either index >= <code>this.length()<\code>
+ * 3. <code>start > end <\code>
+ */
+ public CharSequence subSequence(int start, int end);
+
+ /**
+ * Answers a String with the same characters and ordering of this
+ * CharSequence
+ *
+ * @return a String based on the CharSequence
+ */
+ public String toString();
+}