From 97b8365cafc3a344a22d3980b8ed885f5c6d8357 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 9 Jan 2007 19:58:05 +0000 Subject: Merged gcj-eclipse branch to trunk. From-SVN: r120621 --- libjava/classpath/java/lang/Byte.java | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'libjava/classpath/java/lang/Byte.java') diff --git a/libjava/classpath/java/lang/Byte.java b/libjava/classpath/java/lang/Byte.java index 2560bfc..7f53a49 100644 --- a/libjava/classpath/java/lang/Byte.java +++ b/libjava/classpath/java/lang/Byte.java @@ -1,5 +1,5 @@ /* Byte.java -- object wrapper for byte - Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,10 +49,12 @@ package java.lang; * @author John Keiser * @author Per Bothner * @author Eric Blake (ebb9@email.byu.edu) + * @author Tom Tromey (tromey@redhat.com) + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.1 * @status updated to 1.5 */ -public final class Byte extends Number implements Comparable +public final class Byte extends Number implements Comparable { /** * Compatible with JDK 1.1+. @@ -75,7 +77,7 @@ public final class Byte extends Number implements Comparable * The primitive type byte is represented by this * Class object. */ - public static final Class TYPE = VMClassLoader.getPrimitiveClass('B'); + public static final Class TYPE = (Class) VMClassLoader.getPrimitiveClass('B'); /** * The number of bits needed to represent a byte. @@ -87,6 +89,7 @@ public final class Byte extends Number implements Comparable // valueOf(). We're required to cache all possible values here. private static Byte[] byteCache = new Byte[MAX_VALUE - MIN_VALUE + 1]; + /** * The immutable value of this Byte. * @@ -208,20 +211,18 @@ public final class Byte extends Number implements Comparable * * @param val the value to wrap * @return the Byte - * - * @since 1.5 */ public static Byte valueOf(byte val) { synchronized (byteCache) { - if (byteCache[val - MIN_VALUE] == null) - byteCache[val - MIN_VALUE] = new Byte(val); - return byteCache[val - MIN_VALUE]; + if (byteCache[val - MIN_VALUE] == null) + byteCache[val - MIN_VALUE] = new Byte(val); + return byteCache[val - MIN_VALUE]; } } - /** + /** * Convert the specified String into a Byte. * The String may represent decimal, hexadecimal, or * octal numbers. @@ -369,19 +370,4 @@ public final class Byte extends Number implements Comparable return value - b.value; } - /** - * Behaves like compareTo(Byte) unless the Object - * is not a Byte. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not a Byte - * @see #compareTo(Byte) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((Byte) o); - } } -- cgit v1.1