Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCastException.java Sat May 2 08:09:50 2009 @@ -20,41 +20,39 @@ import org.apache.harmony.luni.util.Msg; /** - * This runtime exception is thrown when a program attempts to cast a an object - * to a type which it is not compatible with. - * + * Thrown when a program attempts to cast a an object to a type with which it is + * not compatible. */ public class ClassCastException extends RuntimeException { private static final long serialVersionUID = -9223365651070458532L; /** - * Constructs a new instance of this class with its walkback filled in. - * + * Constructs a new {@code ClassCastException} that includes the current + * stack trace. */ public ClassCastException() { super(); } /** - * Constructs a new instance of this class with its walkback and message - * filled in. + * Constructs a new {@code ClassCastException} with the current stack trace + * and the specified detail message. * * @param detailMessage - * String The detail message for the exception. + * the detail message for this exception. */ public ClassCastException(String detailMessage) { super(detailMessage); } /** - * Constructs a new instance of this class with its walkback and message - * filled in. + * Constructs a new {@code ClassCastException} with the current stack trace + * and a detail message based on the source and target class. * * @param instanceClass - * Class The class being cast from. - * + * the class being cast from. * @param castClass - * Class The class being cast to. + * the class being cast to. */ ClassCastException(Class> instanceClass, Class> castClass) { super(Msg.getString("K0340", instanceClass.getName(), castClass //$NON-NLS-1$ Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCircularityError.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCircularityError.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCircularityError.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassCircularityError.java Sat May 2 08:09:50 2009 @@ -18,33 +18,33 @@ package java.lang; - /** - * This error is thrown when the VM notices that an attempt is made to load a + * Thrown when the virtual machine notices that an attempt is made to load a * class which would directly or indirectly inherit from one of its subclasses. *
- * Note that this can only occur when inconsistant class files are being loaded, - * since this error would be detected at compile time. + * Note that this error can only occur when inconsistent class files are loaded, + * since it would normally be detected at compile time. */ public class ClassCircularityError extends LinkageError { private static final long serialVersionUID = 1054362542914539689L; /** - * Constructs a new instance of this class with its walkback filled in. - */ - public ClassCircularityError() { - super(); - } + * Constructs a new {@code ClassCircularityError} that include the current + * stack trace. + */ + public ClassCircularityError() { + 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 ClassCircularityError(String detailMessage) { - super(detailMessage); - } + /** + * Constructs a new {@code ClassCircularityError} with the current stack + * trace and the specified detail message. + * + * @param detailMessage + * the detail message for this error. + */ + public ClassCircularityError(String detailMessage) { + super(detailMessage); + } } Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassFormatError.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassFormatError.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassFormatError.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassFormatError.java Sat May 2 08:09:50 2009 @@ -17,30 +17,30 @@ package java.lang; - /** - * This error is thrown by the class loader when it discovers that a class that - * it is loading does not have the correct shape. + * Thrown by a class loader when a class file has an illegal format or if the + * data that it contains can not be interpreted as a class. */ public class ClassFormatError extends LinkageError { private static final long serialVersionUID = -8420114879011949195L; /** - * Constructs a new instance of this class with its walkback filled in. - */ - public ClassFormatError() { - super(); - } + * Constructs a new {@code ClassFormatError} that includes the current stack + * trace. + */ + public ClassFormatError() { + 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 ClassFormatError(String detailMessage) { - super(detailMessage); - } + /** + * Constructs a new {@code ClassFormatError} with the current stack trace + * and the specified detail message. + * + * @param detailMessage + * the detail message for this error. + */ + public ClassFormatError(String detailMessage) { + super(detailMessage); + } } Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassNotFoundException.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassNotFoundException.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassNotFoundException.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ClassNotFoundException.java Sat May 2 08:09:50 2009 @@ -18,63 +18,65 @@ package java.lang; /** - * This exception is thrown when a classloader is unable to find a class. + * Thrown when a class loader is unable to find a class. */ public class ClassNotFoundException extends Exception { - private static final long serialVersionUID = 9176873029745254542L; + private static final long serialVersionUID = 9176873029745254542L; - private Throwable ex; + private Throwable ex; - /** - * Constructs a new instance of this class with its walkback filled in. - */ - public ClassNotFoundException() { - super((Throwable) null); - } - - /** - * Constructs a new instance of this class with its walkback and message - * filled in. - * - * @param detailMessage - * String The detail message for the exception. - */ - public ClassNotFoundException(String detailMessage) { - super(detailMessage, null); - } - - /** - * Constructs a new instance of this class with its walkback, message and - * exception filled in. - * - * @param detailMessage - * String The detail message for the exception. - * @param exception - * Throwable The exception which occurred while loading the - * class. - */ - public ClassNotFoundException(String detailMessage, Throwable exception) { - super(detailMessage); - ex = exception; - } - - /** - * Answers the exception which occurred when loading the class. - * - * @return Throwable The exception which occurred while loading the class. - */ - public Throwable getException() { - return ex; - } - - /** - * Answers the cause of this Throwable, or null if there is no cause. - * - * @return Throwable The receiver's cause. - */ - @Override + /** + * Constructs a new {@code ClassNotFoundException} that includes the current + * stack trace. + */ + public ClassNotFoundException() { + super((Throwable) null); + } + + /** + * Constructs a new {@code ClassNotFoundException} with the current stack + * trace and the specified detail message. + * + * @param detailMessage + * the detail message for this exception. + */ + public ClassNotFoundException(String detailMessage) { + super(detailMessage, null); + } + + /** + * Constructs a new {@code ClassNotFoundException} with the current stack + * trace, the specified detail message and the exception that occurred when + * loading the class. + * + * @param detailMessage + * the detail message for this exception. + * @param exception + * the exception which occurred while loading the class. + */ + public ClassNotFoundException(String detailMessage, Throwable exception) { + super(detailMessage); + ex = exception; + } + + /** + * Returns the exception which occurred when loading the class. + * + * @return Throwable the exception which occurred while loading the class. + */ + public Throwable getException() { + return ex; + } + + /** + * Returns the cause of this Throwable, or {@code null} if there is no + * cause. + * + * @return Throwable the receiver's cause. + */ + @Override public Throwable getCause() { - return ex; - } + return ex; + } } Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/CloneNotSupportedException.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/CloneNotSupportedException.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/CloneNotSupportedException.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/CloneNotSupportedException.java Sat May 2 08:09:50 2009 @@ -17,10 +17,9 @@ package java.lang; - /** - * This exception is thrown when a program attempts to clone an object which - * does not support the Cloneable interface. + * Thrown when a program attempts to clone an object which does not support the + * {@link Cloneable} interface. * * @see Cloneable */ @@ -29,20 +28,21 @@ private static final long serialVersionUID = 5195511250079656443L; /** - * Constructs a new instance of this class with its walkback filled in. - */ - public CloneNotSupportedException() { - super(); - } + * Constructs a new {@code CloneNotSupportedException} that includes the + * current stack trace. + */ + public CloneNotSupportedException() { + 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 CloneNotSupportedException(String detailMessage) { - super(detailMessage); - } + /** + * Constructs a new {@code CloneNotSupportedException} with the current + * stack trace and the specified detail message. + * + * @param detailMessage + * the detail message for this exception. + */ + public CloneNotSupportedException(String detailMessage) { + super(detailMessage); + } } Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Cloneable.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Cloneable.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Cloneable.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Cloneable.java Sat May 2 08:09:50 2009 @@ -19,14 +19,14 @@ /** - * This (empty) interface should be implemented by all classes which wish to - * support cloning. The implementation of clone in class Object checks to ensure - * that the object being cloned implements this interface, and throws - * CloneNotSupportedException if not. + * This (empty) interface must be implemented by all classes that wish to + * support cloning. The implementation of {@code clone()} in {@code Object} + * checks if the object being cloned implements this interface and throws + * {@code CloneNotSupportedException} if it does not. * * @see Object#clone * @see CloneNotSupportedException */ public interface Cloneable { - // Marker interface + // Marker interface } Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java?rev=770909&r1=770908&r2=770909&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java Sat May 2 08:09:50 2009 @@ -17,34 +17,37 @@ package java.lang; - /** - * This interface should be implemented by all classes which wish to define a - * natural ordering of their instances. The ordering rule must be - * transitive and invertible (i.e. the sign of the result of x.compareTo(y) must - * equal the negation of the sign of the result of y.compareTo(x) for all x and - * y). + * This interface should be implemented by all classes that wish to define a + * natural order of their instances. + * {@link java.util.Collections#sort} and {@code java.util.Arrays#sort} can then + * be used to automatically sort lists of classes that implement this interface. + *
+ * The order rule must be both transitive (if {@code x.compareTo(y) < 0} and + * {@code y.compareTo(z) < 0}, then {@code x.compareTo(z) < 0} must hold) and + * invertible (the sign of the result of x.compareTo(y) must be equal to the + * negation of the sign of the result of y.compareTo(x) for all combinations of + * x and y). *
- * In addition, it is desirable (but not required) that when the result of
- * x.compareTo(y) is zero (and only then) the result of x.equals(y) should be
- * true.
+ * In addition, it is recommended (but not required) that if and only if the
+ * result of x.compareTo(y) is zero, then the result of x.equals(y) should be
+ * {@code true}.
*/
public interface Comparable
- * An annotation for marking an element as deprecated.
- *
- * Double is the wrapper for the primitive type
- * Constant for the maximum
- * Constant for the minimum
- * Constant for the Not-a-Number (NaN) value of the
- * Constant for the Positive Infinity value of the
- * Constant for the Negative Infinity value of the
- * Constant for the number of bits to represent a
- * Returns a
- * Converts a
- * Indicates that an
- * Constructs an instance for the passed enum and constant name.
- *
- * The enum type from which the constant name is missing.
- *
- * The name of the constant missing.
- *
- * Float is the wrapper for the primitive type
- * Constant for the maximum
- * Constant for the minimum
- * Constant for the Not-a-Number (NaN) value of the
- * Constant for the Positive Infinity value of the
- * Constant for the Negative Infinity value of the
- * Constant for the number of bits to represent a
- * Returns a
- * Converts a
- * Note that this can only occur when inconsistant class files are being loaded.
+ * Note that this can only occur when inconsistent class files have been loaded.
*/
public class IllegalAccessError extends IncompatibleClassChangeError {
private static final long serialVersionUID = -8988904074992417891L;
/**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public IllegalAccessError() {
- super();
- }
+ * Constructs a new {@code IllegalAccessError} that includes the current
+ * stack trace.
+ */
+ public IllegalAccessError() {
+ 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 IllegalAccessError(String detailMessage) {
- super(detailMessage);
- }
+ /**
+ * Constructs a new {@code IllegalAccessError} with the current stack trace
+ * and the specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this error.
+ */
+ public IllegalAccessError(String detailMessage) {
+ super(detailMessage);
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessException.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessException.java Sat May 2 08:09:50 2009
@@ -17,32 +17,31 @@
package java.lang;
-
/**
- * This exception is thrown when a program attempts to access a field or method
- * which is not accessible from the location where the reference is made.
- *
+ * Thrown when a program attempts to access a field or method which is not
+ * accessible from the location where the reference is made.
*/
public class IllegalAccessException extends Exception {
private static final long serialVersionUID = 6616958222490762034L;
/**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public IllegalAccessException() {
- 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 IllegalAccessException(String detailMessage) {
- super(detailMessage);
- }
+ * Constructs a new {@code IllegalAccessException} that includes the current
+ * stack trace.
+ */
+ public IllegalAccessException() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code IllegalAccessException} with the current stack
+ * trace and the specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this exception.
+ */
+ public IllegalAccessException(String detailMessage) {
+ super(detailMessage);
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalArgumentException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalArgumentException.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalArgumentException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalArgumentException.java Sat May 2 08:09:50 2009
@@ -17,37 +17,41 @@
package java.lang;
-
/**
- * This runtime exception is thrown when a method is invoked with an argument
- * which it can not reasonably deal with.
+ * Thrown when a method is invoked with an argument which it can not reasonably
+ * deal with.
*/
public class IllegalArgumentException extends RuntimeException {
- private static final long serialVersionUID = -5365630128856068164L;
+ private static final long serialVersionUID = -5365630128856068164L;
- /**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public IllegalArgumentException() {
- super();
- }
+ /**
+ * Constructs a new {@code IllegalArgumentException} that includes the
+ * current stack trace.
+ */
+ public IllegalArgumentException() {
+ 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 IllegalArgumentException(String detailMessage) {
- super(detailMessage);
- }
+ /**
+ * Constructs a new {@code IllegalArgumentException} with the current stack
+ * trace and the specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this exception.
+ */
+ public IllegalArgumentException(String detailMessage) {
+ super(detailMessage);
+ }
/**
- * Constructs a new instance with a message and cause. Constructs a new instance with a cause. Constructs a new instance with a message and cause. Constructs a new instance with a cause.double.
- * double value, (2 - 2-52/sup>) *
+ * Constant for the maximum {@code double} value, (2 - 2-52) *
* 21023.
- * double value, 2-1074.
- * double
- * type.
- * double
- * type.
- * double
- * type.
- * double in
- * two's compliment form.
- *
+ *
*
* @param object
- * the Double to compare to the receiver
- *
- * @return Returns greater than zero when this.doubleValue() is greater than
- * object.doubleValue(), zero when this.doubleValue() equals
- * object.doubleValue(), and less than zero when this.doubleValue()
- * is less than object.doubleValue()
- *
+ * the double object to compare this object to.
+ * @return a negative value if the value of this double is less than the
+ * value of {@code object}; 0 if the value of this double and the
+ * value of {@code object} are equal; a positive value if the value
+ * of this double is greater than the value of {@code object}.
* @throws NullPointerException
- * if object is null.
+ * if {@code object} is {@code null}.
+ * @see java.lang.Comparable
* @since 1.2
*/
public int compareTo(Double object) {
@@ -158,38 +147,44 @@
return value > object.value ? 1 : -1;
}
- /**
- * Answers the byte value which the receiver represents
- *
- * @return byte the value of the receiver.
- */
@Override
public byte byteValue() {
return (byte) value;
}
/**
- * Answers the binary representation of the argument, as a long.
+ * Converts the specified double value to a binary representation conforming
+ * to the IEEE 754 floating-point double precision bit layout. All
+ * Not-a-Number (NaN) values are converted to a single NaN
+ * representation ({@code 0x7ff8000000000000L}).
*
* @param value
- * The double value to convert
- * @return the bits of the double.
+ * the double value to convert.
+ * @return the IEEE 754 floating-point double precision representation of
+ * {@code value}.
+ * @see #doubleToRawLongBits(double)
+ * @see #longBitsToDouble(long)
*/
public static native long doubleToLongBits(double value);
/**
- * Answers the binary representation of the argument, as a long.
+ * Converts the specified double value to a binary representation conforming
+ * to the IEEE 754 floating-point double precision bit layout.
+ * Not-a-Number (NaN) values are preserved.
*
* @param value
- * The double value to convert
- * @return the bits of the double.
+ * the double value to convert.
+ * @return the IEEE 754 floating-point double precision representation of
+ * {@code value}.
+ * @see #doubleToLongBits(double)
+ * @see #longBitsToDouble(long)
*/
public static native long doubleToRawLongBits(double value);
/**
- * Answers the receiver's value as a double.
+ * Gets the primitive value of this double.
*
- * @return the receiver's value
+ * @return this object's primitive value.
*/
@Override
public double doubleValue() {
@@ -197,16 +192,15 @@
}
/**
- * Compares the argument to the receiver, and answers true if they represent
- * the same object using a class specific comparison. For
- * Doubles, the check verifies that the receiver's value's bit pattern
- * matches the bit pattern of the argument, which must also be a Double.
+ * Compares this object with the specified object and indicates if they are
+ * equal. In order to be equal, {@code object} must be an instance of
+ * {@code Double} and the bit pattern of its double value is the same as
+ * this object's.
*
* @param object
- * the object to compare with this object
- * @return true if the object is the same as this object
- * false if it is different from this object
- * @see #hashCode
+ * the object to compare this double with.
+ * @return {@code true} if the specified object is equal to this
+ * {@code Double}; {@code false} otherwise.
*/
@Override
public boolean equals(Object object) {
@@ -215,117 +209,94 @@
&& (doubleToLongBits(this.value) == doubleToLongBits(((Double) object).value));
}
- /**
- * Answers the float value which the receiver represents
- *
- * @return float the value of the receiver.
- */
@Override
public float floatValue() {
return (float) value;
}
- /**
- * Answers an integer hash code for the receiver. Any two objects which
- * answer true when passed to equals must
- * answer the same value for this method.
- *
- * @return the receiver's hash
- *
- * @see #equals
- */
@Override
public int hashCode() {
long v = doubleToLongBits(value);
return (int) (v ^ (v >>> 32));
}
- /**
- * Answers the receiver's value as an integer.
- *
- * @return the receiver's value as an integer
- */
@Override
public int intValue() {
return (int) value;
}
/**
- * Answers true if the receiver represents an infinite quantity, and false
- * otherwise.
+ * Indicates whether this object represents an infinite value.
*
- * @return true if the argument is positive or negative
- * infinity false if it is not an infinite value
+ * @return {@code true} if the value of this double is positive or negative
+ * infinity; {@code false} otherwise.
*/
public boolean isInfinite() {
return isInfinite(value);
}
/**
- * Answers true if the argument represents an infinite quantity, and false
- * otherwise.
+ * Indicates whether the specified double represents an infinite value.
*
* @param d
- * value to check for infinitness.
- * @return true if the argument is positive or negative
- * infinity false if it is not an infinite value
+ * the double to check.
+ * @return {@code true} if the value of {@code d} is positive or negative
+ * infinity; {@code false} otherwise.
*/
public static boolean isInfinite(double d) {
return (d == POSITIVE_INFINITY) || (d == NEGATIVE_INFINITY);
}
/**
- * Answers true if the receiver does not represent a valid float quantity.
+ * Indicates whether this object is a Not-a-Number (NaN) value.
*
- * @return true if the argument is Not A Number
- * false if it is a (potentially infinite) float
- * number
+ * @return {@code true} if this double is Not-a-Number;
+ * {@code false} if it is a (potentially infinite) double number.
*/
public boolean isNaN() {
return isNaN(value);
}
/**
- * Answers true if the argument does not represent a valid double quantity.
+ * Indicates whether the specified double is a Not-a-Number (NaN)
+ * value.
*
* @param d
- * value to check for numberness.
- * @return true if the argument is Not A Number
- * false if it is a (potentially infinite) double
- * number
+ * the double value to check.
+ * @return {@code true} if {@code d} is Not-a-Number;
+ * {@code false} if it is a (potentially infinite) double number.
*/
public static boolean isNaN(double d) {
return d != d;
}
/**
- * Answers a double built from the binary representation given in the
- * argument.
+ * Converts the specified IEEE 754 floating-point double precision bit
+ * pattern to a Java double value.
*
* @param bits
- * the bits of the double
- * @return the double which matches the bits
+ * the IEEE 754 floating-point double precision representation of
+ * a double value.
+ * @return the double value converted from {@code bits}.
+ * @see #doubleToLongBits(double)
+ * @see #doubleToRawLongBits(double)
*/
public static native double longBitsToDouble(long bits);
- /**
- * Answers the long value which the receiver represents
- *
- * @return long the value of the receiver.
- */
@Override
public long longValue() {
return (long) value;
}
/**
- * Answers the double which matches the passed in string.
- * NumberFormatException is thrown if the string does not represent a valid
- * double.
+ * Parses the specified string as a double value.
*
* @param string
- * the value to convert
- * @return a double which would print as the argument
+ * the string representation of a double value.
+ * @return the primitive double value represented by {@code string}.
+ * @throws NumberFormatException
+ * if {@code string} is {@code null}, has a length of zero or
+ * can not be parsed as a double value.
*/
public static double parseDouble(String string)
throws NumberFormatException {
@@ -333,63 +304,59 @@
.parseDouble(string);
}
- /**
- * Answers the short value which the receiver represents
- *
- * @return short the value of the receiver.
- */
@Override
public short shortValue() {
return (short) value;
}
- /**
- * Answers a string containing a concise, human-readable description of the
- * receiver.
- *
- * @return a printable representation for the receiver.
- */
@Override
public String toString() {
return Double.toString(value);
}
/**
- * Answers a string containing a printable representation of the argument.
+ * Returns a string containing a concise, human-readable description of the
+ * specified double value.
*
* @param d
- * the double to print
- * @return a printable representation of the argument.
+ * the double to convert to a string.
+ * @return a printable representation of {@code d}.
*/
public static String toString(double d) {
return org.apache.harmony.luni.util.NumberConverter.convert(d);
}
/**
- * Answers the double which matches the passed in string.
- * NumberFormatException is thrown if the string does not represent a valid
- * double.
+ * Parses the specified string as a double value.
*
* @param string
- * the value to convert
- * @return a double which would print as the argument
+ * the string representation of a double value.
+ * @return a {@code Double} instance containing the double value represented
+ * by {@code string}.
+ * @throws NumberFormatException
+ * if {@code string} is {@code null}, has a length of zero or
+ * can not be parsed as a double value.
+ * @see #parseDouble(String)
*/
public static Double valueOf(String string) throws NumberFormatException {
return new Double(parseDouble(string));
}
/**
- * Compares the two doubles. NaN is equal to NaN, and is greater than other
- * double values. 0d is greater than -0d.
+ * Compares the two specified double values. There are two special cases:
+ *
+ *
*
* @param double1
- * the first value to compare
+ * the first value to compare.
* @param double2
- * the second value to compare
- *
- * @return Returns greater than zero when double1 is greater than double2,
- * zero when double1 equals double2, and less than zero when double1
- * is less than double2
+ * the second value to compare.
+ * @return a negative value if {@code double1} is less than {@code double2};
+ * 0 if {@code double1} and {@code double2} are equal; a positive
+ * value if {@code double1} is greater than {@code double2}.
*/
public static int compare(double double1, double double2) {
long d1, d2;
@@ -414,15 +381,11 @@
}
/**
- * Double instance for the double
- * value passed. This method is preferred over the constructor, as this
- * method may maintain a cache of instances.
- * Double instance.
+ * the double value to store in the instance.
+ * @return a {@code Double} instance containing {@code d}.
* @since 1.5
*/
public static Double valueOf(double d) {
@@ -430,14 +393,11 @@
}
/**
- * double into a hexadecimal string
- * representation.
- * double to convert.
- * @return The hexadecimal string representation of f.
+ * the double to convert.
+ * @return the hexadecimal string representation of {@code d}.
* @since 1.5
*/
public static String toHexString(double d) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java Sat May 2 08:09:50 2009
@@ -24,7 +24,9 @@
import org.apache.harmony.luni.util.Msg;
/**
- * The superclass of all enumerated types.
+ * The superclass of all enumerated types. Actual enumeration types inherit from
+ * this class, but extending this class does not make a class an enumration
+ * type, since the compiler needs to generate special information for it.
*/
public abstract class EnumEnum declaration.
+ * Returns the name of this enum constant. The name is the field as it
+ * appears in the {@code enum} declaration.
*
- * @return the precise enum constant name.
+ * @return the name of this enum constant.
* @see #toString()
*/
public final String name() {
@@ -60,20 +63,20 @@
}
/**
- * Answers the position of the enum constant in the declaration. The first
- * constant has and ordinal value of zero.
+ * Returns the position of the enum constant in the declaration. The first
+ * constant has an ordinal value of zero.
*
- * @return the constant's ordinal value.
+ * @return the ordinal value of this enum constant.
*/
public final int ordinal() {
return ordinal;
}
/**
- * Answer a string representation of the receiver suitable for display to a
- * programmer.
+ * Returns a string containing a concise, human-readable description of this
+ * object. In this case, the enum constant's name is returned.
*
- * @return the displayable string name.
+ * @return a printable representation of this object.
*/
@Override
public String toString() {
@@ -81,32 +84,32 @@
}
/**
- * Answers true only if the receiver is equal to the argument. Since enums
- * are unique this is equivalent to an identity test.
- *
- * @return true if the receiver and argument are equal, otherwise return
- * false.
+ * Compares this object with the specified object and indicates if they are
+ * equal. In order to be equal, {@code object} must be identical to this
+ * enum constant.
+ *
+ * @param other
+ * the object to compare this enum constant with.
+ * @return {@code true} if the specified object is equal to this
+ * {@code Enum}; {@code false} otherwise.
*/
@Override
public final boolean equals(Object other) {
return this == other;
}
- /**
- * Answers the hash of the receiver.
- *
- * @return the hash code.
- */
@Override
public final int hashCode() {
return ordinal + (name == null ? 0 : name.hashCode());
}
/**
- * Enums are singletons, they may not be cloned. This method always throws a
- * {@link CloneNotSupportedException}.
+ * {@code Enum} objects are singletons, they may not be cloned. This method
+ * always throws a {@code CloneNotSupportedException}.
*
* @return does not return.
+ * @throws CloneNotSupportedException
+ * is always thrown.
*/
@Override
protected final Object clone() throws CloneNotSupportedException {
@@ -115,23 +118,25 @@
}
/**
- * Answers the comparative ordering of the receiver and the given argument.
- * If the receiver is naturally ordered before the actual argument then the
- * result is negative, if the receiver is naturally ordered in equal
- * position to the actual argument then the result is zero, and if the
- * receiver is naturally ordered after the actual argument then the result
- * is positive.
- *
- * @return negative, zero, or positive value depending upon before, equal,
- * or after natural order respectively.
- * @see Comparable#compareTo(Object)
+ * Compares this object to the specified enum object to determine their
+ * relative order. This method compares the object's ordinal values, that
+ * is, their position in the enum declaration.
+ *
+ * @param o
+ * the enum object to compare this object to.
+ * @return a negative value if the ordinal value of this enum constant is
+ * less than the ordinal value of {@code o}; 0 if the ordinal
+ * values of this enum constant and {@code o} are equal; a positive
+ * value if the ordinal value of this enum constant is greater than
+ * the ordinal value of {@code o}.
+ * @see java.lang.Comparable
*/
public final int compareTo(E o) {
return ordinal - o.ordinal;
}
/**
- * Answers the enum constant's declaring class.
+ * Returns the enum constant's declaring class.
*
* @return the class object representing the constant's enum type.
*/
@@ -146,20 +151,19 @@
}
/**
- * Answers the named constant of the given enum type.
+ * Returns the constant with the specified name of the specified enum type.
*
* @param enumType
* the class of the enumerated type to search for the constant
* value.
* @param name
* the name of the constant value to find.
- * @return the enum constant
+ * @return the enum constant.
* @throws NullPointerException
- * if either the enumType or name
- * are null.
+ * if either {@code enumType} or {@code name} are {@code null}.
* @throws IllegalArgumentException
- * if enumType is not an enumerated type or does
- * not have a constant value called name.
+ * if {@code enumType} is not an enumerated type or does not
+ * have a constant value called {@code name}.
*/
public static enum constant does not exist for a
- * particular name.
- * Class instance.
+ * Gets the enum type for which the constant name is missing.
+ *
+ * @return the enum type for which a constant name has not been found.
*/
@SuppressWarnings("unchecked")
public Class extends Enum> enumType() {
@@ -66,11 +62,10 @@
}
/**
- * String instance.
+ * @return the name of the constant that has not been found in the enum
+ * type.
*/
public String constantName() {
return constantName;
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Error.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Error.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Error.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Error.java Sat May 2 08:09:50 2009
@@ -19,8 +19,8 @@
/**
- * This class is the superclass of all classes which represent unrecoverable
- * errors. When Errors are thrown, they should not be caught by application
+ * {@code Error} is the superclass of all classes that represent unrecoverable
+ * errors. When errors are thrown, they should not be caught by application
* code.
*
* @see Throwable
@@ -29,47 +29,47 @@
*/
public class Error extends Throwable {
- private static final long serialVersionUID = 4980196508277280342L;
+ private static final long serialVersionUID = 4980196508277280342L;
- /**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public Error() {
- 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 Error(String detailMessage) {
- super(detailMessage);
- }
-
- /**
- * Constructs a new instance of this class with its walkback, message and
- * cause filled in.
- *
- * @param detailMessage
- * String The detail message for the exception.
- * @param throwable
- * The cause of this Throwable
- */
- public Error(String detailMessage, Throwable throwable) {
- super(detailMessage, throwable);
- }
-
- /**
- * Constructs a new instance of this class with its walkback and cause
- * filled in.
- *
- * @param throwable
- * The cause of this Throwable
- */
- public Error(Throwable throwable) {
- super(throwable);
- }
+ /**
+ * Constructs a new {@code Error} that includes the current stack trace.
+ */
+ public Error() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code Error} with the current stack trace and the
+ * specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this error.
+ */
+ public Error(String detailMessage) {
+ super(detailMessage);
+ }
+
+ /**
+ * Constructs a new {@code Error} with the current stack trace, the
+ * specified detail message and the specified cause.
+ *
+ * @param detailMessage
+ * the detail message for this error.
+ * @param throwable
+ * the cause of this error.
+ */
+ public Error(String detailMessage, Throwable throwable) {
+ super(detailMessage, throwable);
+ }
+
+ /**
+ * Constructs a new {@code Error} with the current stack trace and the
+ * specified cause.
+ *
+ * @param throwable
+ * the cause of this error.
+ */
+ public Error(Throwable throwable) {
+ super(throwable);
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Exception.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Exception.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Exception.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Exception.java Sat May 2 08:09:50 2009
@@ -19,8 +19,8 @@
/**
- * This class is the superclass of all classes which represent recoverable
- * exceptions. When Exceptions are thrown, they may be caught by application
+ * {@code Exception} is the superclass of all classes that represent recoverable
+ * exceptions. When exceptions are thrown, they may be caught by application
* code.
*
* @see Throwable
@@ -28,47 +28,47 @@
* @see RuntimeException
*/
public class Exception extends Throwable {
- private static final long serialVersionUID = -3387516993124229948L;
+ private static final long serialVersionUID = -3387516993124229948L;
- /**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public Exception() {
- 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 Exception(String detailMessage) {
- super(detailMessage);
- }
-
- /**
- * Constructs a new instance of this class with its walkback, message and
- * cause filled in.
- *
- * @param detailMessage
- * String The detail message for the exception.
- * @param throwable
- * The cause of this Throwable
- */
- public Exception(String detailMessage, Throwable throwable) {
- super(detailMessage, throwable);
- }
-
- /**
- * Constructs a new instance of this class with its walkback and cause
- * filled in.
- *
- * @param throwable
- * The cause of this Throwable
- */
- public Exception(Throwable throwable) {
- super(throwable);
- }
+ /**
+ * Constructs a new {@code Exception} that includes the current stack trace.
+ */
+ public Exception() {
+ super();
+ }
+
+ /**
+ * Constructs a new {@code Exception} with the current stack trace and the
+ * specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this exception.
+ */
+ public Exception(String detailMessage) {
+ super(detailMessage);
+ }
+
+ /**
+ * Constructs a new {@code Exception} with the current stack trace, the
+ * specified detail message and the specified cause.
+ *
+ * @param detailMessage
+ * the detail message for this exception.
+ * @param throwable
+ * the cause of this exception.
+ */
+ public Exception(String detailMessage, Throwable throwable) {
+ super(detailMessage, throwable);
+ }
+
+ /**
+ * Constructs a new {@code Exception} with the current stack trace and the
+ * specified cause.
+ *
+ * @param throwable
+ * the cause of this exception.
+ */
+ public Exception(Throwable throwable) {
+ super(throwable);
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ExceptionInInitializerError.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ExceptionInInitializerError.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ExceptionInInitializerError.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ExceptionInInitializerError.java Sat May 2 08:09:50 2009
@@ -18,62 +18,65 @@
package java.lang;
/**
- * This error is thrown when an exception occurs during class initialization.
+ * Thrown when an exception occurs during class initialization.
*/
public class ExceptionInInitializerError extends LinkageError {
- private static final long serialVersionUID = 1521711792217232256L;
+ private static final long serialVersionUID = 1521711792217232256L;
- private Throwable exception;
+ private Throwable exception;
- /**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public ExceptionInInitializerError() {
- super();
- initCause(null);
- }
-
- /**
- * Constructs a new instance of this class with its walkback and message
- * filled in.
- *
- * @param detailMessage
- * String The detail message for the exception.
- */
- public ExceptionInInitializerError(String detailMessage) {
- super(detailMessage);
- initCause(null);
- }
-
- /**
- * Constructs a new instance of this class with its walkback and exception
- * filled in. The exception should be the one which originally occurred in
- * the class initialization code.
- *
- * @param exception
- * Throwable The exception which caused the problem.
- */
- public ExceptionInInitializerError(Throwable exception) {
- super();
- this.exception = exception;
- initCause(exception);
- }
-
- /**
- * Answers the exception which was passed in when the instance was created.
- */
- public Throwable getException() {
- return exception;
- }
-
- /**
- * Answers the cause of this Throwable, or null if there is no cause.
- *
- * @return Throwable The receiver's cause.
- */
- @Override
+ /**
+ * Constructs a new {@code ExceptionInInitializerError} that includes the
+ * current stack trace.
+ */
+ public ExceptionInInitializerError() {
+ super();
+ initCause(null);
+ }
+
+ /**
+ * Constructs a new {@code ExceptionInInitializerError} with the current
+ * stack trace and the specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this error.
+ */
+ public ExceptionInInitializerError(String detailMessage) {
+ super(detailMessage);
+ initCause(null);
+ }
+
+ /**
+ * Constructs a new {@code ExceptionInInitializerError} with the current
+ * stack trace and the specified cause. The exception should be the one
+ * which originally occurred in the class initialization code.
+ *
+ * @param exception
+ * the exception that caused this error.
+ */
+ public ExceptionInInitializerError(Throwable exception) {
+ super();
+ this.exception = exception;
+ initCause(exception);
+ }
+
+ /**
+ * Returns the exception that is the cause of this error.
+ *
+ * @return the exception that caused this error.
+ */
+ public Throwable getException() {
+ return exception;
+ }
+
+ /**
+ * Returns the cause of this error, or {@code null} if there is no cause.
+ *
+ * @return the exception that caused this error.
+ */
+ @Override
public Throwable getCause() {
- return exception;
- }
+ return exception;
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java Sat May 2 08:09:50 2009
@@ -18,9 +18,7 @@
package java.lang;
/**
- * float.
- * float value, (2 - 2-23) *
- * 2127.
- * float value, 2-149.
- * float
- * type.
- * float
- * type.
- * float
- * type.
- * float in
- * two's compliment form.
- *
+ *
*
* @param object
- * the Float to compare to the receiver
- *
- * @return Returns greater than zero when this.floatValue() is greater than
- * object.floatValue(), zero when this.floatValue() equals
- * object.floatValue(), and less than zero when this.floatValue() is
- * less than object.floatValue()
- * @throws NullPointerException
- * if object is null.
+ * the float object to compare this object to.
+ * @return a negative value if the value of this float is less than the
+ * value of {@code object}; 0 if the value of this float and the
+ * value of {@code object} are equal; a positive value if the value
+ * of this float is greater than the value of {@code object}.
+ * @see java.lang.Comparable
* @since 1.2
*/
public int compareTo(Float object) {
@@ -166,37 +151,25 @@
return value > object.value ? 1 : -1;
}
- /**
- * Answers the byte value which the receiver represents
- *
- * @return byte the value of the receiver.
- */
@Override
public byte byteValue() {
return (byte) value;
}
- /**
- * Answers the double value which the receiver represents
- *
- * @return double the value of the receiver.
- */
@Override
public double doubleValue() {
return value;
}
/**
- * Compares the argument to the receiver, and answers true if they represent
- * the same object using a class specific comparison. For Floats,
- * the check verifies that the receiver's value's bit pattern matches the
- * bit pattern of the argument, which must also be a Float.
+ * Compares this instance with the specified object and indicates if they
+ * are equal. In order to be equal, {@code object} must be an instance of
+ * {@code Float} and have the same float value as this object.
*
* @param object
- * the object to compare with this object
- * @return true if the object is the same as this object
- * false if it is different from this object
- * @see #hashCode
+ * the object to compare this float with.
+ * @return {@code true} if the specified object is equal to this
+ * {@code Float}; {@code false} otherwise.
*/
@Override
public boolean equals(Object object) {
@@ -206,133 +179,126 @@
}
/**
- * Answers the binary representation of the argument, as an int.
+ * Converts the specified float value to a binary representation conforming
+ * to the IEEE 754 floating-point single precision bit layout. All
+ * Not-a-Number (NaN) values are converted to a single NaN
+ * representation ({@code 0x7ff8000000000000L}).
*
* @param value
- * The float value to convert
- * @return the bits of the float.
+ * the float value to convert.
+ * @return the IEEE 754 floating-point single precision representation of
+ * {@code value}.
+ * @see #floatToRawIntBits(float)
+ * @see #intBitsToFloat(int)
*/
public static native int floatToIntBits(float value);
/**
- * Answers the binary representation of the argument, as an int.
+ * Converts the specified float value to a binary representation conforming
+ * to the IEEE 754 floating-point single precision bit layout.
+ * Not-a-Number (NaN) values are preserved.
*
* @param value
- * The float value to convert
- * @return the bits of the float.
+ * the float value to convert.
+ * @return the IEEE 754 floating-point single precision representation of
+ * {@code value}.
+ * @see #floatToIntBits(float)
+ * @see #intBitsToFloat(int)
*/
public static native int floatToRawIntBits(float value);
/**
- * Answers the receiver's value as a float.
+ * Gets the primitive value of this float.
*
- * @return the receiver's value
+ * @return this object's primitive value.
*/
@Override
public float floatValue() {
return value;
}
- /**
- * Answers an integer hash code for the receiver. Any two objects which
- * answer true when passed to equals must
- * answer the same value for this method.
- *
- * @return the receiver's hash
- *
- * @see #equals
- */
@Override
public int hashCode() {
return floatToIntBits(value);
}
/**
- * Answers a float built from the binary representation given in the
- * argument.
+ * Converts the specified IEEE 754 floating-point single precision bit
+ * pattern to a Java float value.
*
* @param bits
- * the bits of the float
- * @return the float which matches the bits
+ * the IEEE 754 floating-point single precision representation of
+ * a float value.
+ * @return the float value converted from {@code bits}.
+ * @see #floatToIntBits(float)
+ * @see #floatToRawIntBits(float)
*/
public static native float intBitsToFloat(int bits);
- /**
- * Answers the int value which the receiver represents
- *
- * @return int the value of the receiver.
- */
@Override
public int intValue() {
return (int) value;
}
/**
- * Answers true if the receiver represents an infinite quantity, and false
- * otherwise.
+ * Indicates whether this object represents an infinite value.
*
- * @return true if the argument is positive or negative
- * infinity false if it is not an infinite value
+ * @return {@code true} if the value of this float is positive or negative
+ * infinity; {@code false} otherwise.
*/
public boolean isInfinite() {
return isInfinite(value);
}
/**
- * Answers true if the argument represents an infinite quantity, and false
- * otherwise.
+ * Indicates whether the specified float represents an infinite value.
*
* @param f
- * value to check for infinitness.
- * @return true if the argument is positive or negative
- * infinity false if it is not an infinite value
+ * the float to check.
+ * @return {@code true} if the value of {@code f} is positive or negative
+ * infinity; {@code false} otherwise.
*/
public static boolean isInfinite(float f) {
return (f == POSITIVE_INFINITY) || (f == NEGATIVE_INFINITY);
}
/**
- * Answers true if the receiver does not represent a valid float quantity.
+ * Indicates whether this object is a Not-a-Number (NaN) value.
*
- * @return true if the argument is Not A Number
- * false if it is a (potentially infinite) float
- * number
+ * @return {@code true} if this float is Not-a-Number;
+ * {@code false} if it is a (potentially infinite) float number.
*/
public boolean isNaN() {
return isNaN(value);
}
/**
- * Answers true if the argument does not represent a valid float quantity.
+ * Indicates whether the specified float is a Not-a-Number (NaN)
+ * value.
*
* @param f
- * value to check for numberness.
- * @return true if the argument is Not A Number
- * false if it is a (potentially infinite) float
- * number
+ * the float value to check.
+ * @return {@code true} if {@code f} is Not-a-Number;
+ * {@code false} if it is a (potentially infinite) float number.
*/
public static boolean isNaN(float f) {
return f != f;
}
- /**
- * Answers the long value which the receiver represents
- *
- * @return long the value of the receiver.
- */
@Override
public long longValue() {
return (long) value;
}
/**
- * Answers the float which matches the passed in string.
- * NumberFormatException is thrown if the string does not represent a valid
- * float.
+ * Parses the specified string as a float value.
*
* @param string
- * the value to convert
- * @return a float which would print as the argument
+ * the string representation of a float value.
+ * @return the primitive float value represented by {@code string}.
+ * @throws NumberFormatException
+ * if {@code string} is {@code null}, has a length of zero or
+ * can not be parsed as a float value.
* @see #valueOf(String)
* @since 1.2
*/
@@ -341,64 +307,59 @@
.parseFloat(string);
}
- /**
- * Answers the short value which the receiver represents
- *
- * @return short the value of the receiver.
- * @since 1.1
- */
@Override
public short shortValue() {
return (short) value;
}
- /**
- * Answers a string containing a concise, human-readable description of the
- * receiver.
- *
- * @return a printable representation for the receiver.
- */
@Override
public String toString() {
return Float.toString(value);
}
/**
- * Answers a string containing a printable representation of the argument.
+ * Returns a string containing a concise, human-readable description of the
+ * specified float value.
*
* @param f
- * the float to print
- * @return a printable representation of the argument.
+ * the float to convert to a string.
+ * @return a printable representation of {@code f}.
*/
public static String toString(float f) {
return org.apache.harmony.luni.util.NumberConverter.convert(f);
}
/**
- * Answers the float which matches the passed in string.
- * NumberFormatException is thrown if the string does not represent a valid
- * float.
+ * Parses the specified string as a float value.
*
* @param string
- * the value to convert
- * @return a float which would print as the argument
+ * the string representation of a float value.
+ * @return a {@code Float} instance containing the float value represented
+ * by {@code string}.
+ * @throws NumberFormatException
+ * if {@code string} is {@code null}, has a length of zero or
+ * can not be parsed as a float value.
+ * @see #parseFloat(String)
*/
public static Float valueOf(String string) throws NumberFormatException {
return valueOf(parseFloat(string));
}
/**
- * Compares the two floats. NaN is equal to NaN, and is greater than other
- * float values. 0f is greater than -0f.
+ * Compares the two specified float values. There are two special cases:
+ *
+ *
*
* @param float1
- * the first value to compare
+ * the first value to compare.
* @param float2
- * the second value to compare
- *
- * @return Returns greater than zero when float1 is greater than float2,
- * zero when float1 equals float2, and less than zero when float1 is
- * less than float2
+ * the second value to compare.
+ * @return a negative value if {@code float1} is less than {@code float2};
+ * 0 if {@code float1} and {@code float2} are equal; a positive
+ * value if {@code float1} is greater than {@code float2}.
* @since 1.4
*/
public static int compare(float float1, float float2) {
@@ -424,15 +385,11 @@
}
/**
- * Float instance for the float
- * value passed. This method is preferred over the constructor, as this
- * method may maintain a cache of instances.
- * Float instance.
+ * the float value to store in the instance.
+ * @return a {@code Float} instance containing {@code f}.
* @since 1.5
*/
public static Float valueOf(float f) {
@@ -440,13 +397,11 @@
}
/**
- * float into a hexadecimal string representation.
- * float to convert.
- * @return The hexadecimal string representation of f.
+ * the float to convert.
+ * @return the hexadecimal string representation of {@code f}.
* @since 1.5
*/
public static String toHexString(float f) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessError.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessError.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessError.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalAccessError.java Sat May 2 08:09:50 2009
@@ -17,32 +17,32 @@
package java.lang;
-
/**
- * This error is thrown when the VM notices that a an attempt is being made to
- * access a field which is not accessable from where it is referenced.
+ * Thrown when the virtual machine notices that a program tries access a field
+ * which is not accessible from where it is referenced.
* null.
+ * Constructs a new {@code IllegalArgumentException} with the current stack
+ * trace, the specified detail message and the specified cause.
+ *
+ * @param message
+ * the detail message for this exception.
+ * @param cause
+ * the cause of this exception, may be {@code null}.
* @since 1.5
*/
public IllegalArgumentException(String message, Throwable cause) {
@@ -55,8 +59,11 @@
}
/**
- * null.
+ * Constructs a new {@code IllegalArgumentException} with the current stack
+ * trace and the specified cause.
+ *
+ * @param cause
+ * the cause of this exception, may be {@code null}.
* @since 1.5
*/
public IllegalArgumentException(Throwable cause) {
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalMonitorStateException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalMonitorStateException.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalMonitorStateException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalMonitorStateException.java Sat May 2 08:09:50 2009
@@ -17,31 +17,31 @@
package java.lang;
-
/**
- * This runtime exception is thrown when a monitor operation is attempted when
- * the monitor is not in the correct state, for example when a thread attempts
- * to exit a monitor which it did not own.
+ * Thrown when a monitor operation is attempted when the monitor is not in the
+ * correct state, for example when a thread attempts to exit a monitor which it
+ * does not own.
*/
public class IllegalMonitorStateException extends RuntimeException {
private static final long serialVersionUID = 3713306369498869069L;
/**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public IllegalMonitorStateException() {
- super();
- }
+ * Constructs a new {@code IllegalMonitorStateException} that includes the
+ * current stack trace.
+ */
+ public IllegalMonitorStateException() {
+ 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 IllegalMonitorStateException(String detailMessage) {
- super(detailMessage);
- }
+ /**
+ * Constructs a new {@code IllegalArgumentException} with the current stack
+ * trace and the specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this exception.
+ */
+ public IllegalMonitorStateException(String detailMessage) {
+ super(detailMessage);
+ }
}
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalStateException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalStateException.java?rev=770909&r1=770908&r2=770909&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalStateException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/IllegalStateException.java Sat May 2 08:09:50 2009
@@ -17,37 +17,41 @@
package java.lang;
-
/**
- * This runtime exception is thrown when an action is attempted at a time when
- * the virtual machine is not in the correct state.
+ * Thrown when an action is attempted at a time when the virtual machine is not
+ * in the correct state.
*/
public class IllegalStateException extends RuntimeException {
- private static final long serialVersionUID = -1848914673093119416L;
+ private static final long serialVersionUID = -1848914673093119416L;
- /**
- * Constructs a new instance of this class with its walkback filled in.
- */
- public IllegalStateException() {
- super();
- }
+ /**
+ * Constructs a new {@code IllegalStateException} that includes the current
+ * stack trace.
+ */
+ public IllegalStateException() {
+ 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 IllegalStateException(String detailMessage) {
- super(detailMessage);
- }
+ /**
+ * Constructs a new {@code IllegalStateException} with the current stack
+ * trace and the specified detail message.
+ *
+ * @param detailMessage
+ * the detail message for this exception.
+ */
+ public IllegalStateException(String detailMessage) {
+ super(detailMessage);
+ }
/**
- * null.
+ * Constructs a new {@code IllegalStateException} with the current stack
+ * trace, the specified detail message and the specified cause.
+ *
+ * @param message
+ * the detail message for this exception.
+ * @param cause
+ * the cause of this exception.
* @since 1.5
*/
public IllegalStateException(String message, Throwable cause) {
@@ -55,8 +59,11 @@
}
/**
- * null.
+ * Constructs a new {@code IllegalStateException} with the current stack
+ * trace and the specified cause.
+ *
+ * @param cause
+ * the cause of this exception, may be {@code null}.
* @since 1.5
*/
public IllegalStateException(Throwable cause) {