/[classpath]/classpath/java/lang/Short.java
ViewVC logotype

Diff of /classpath/java/lang/Short.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by mark, Sat Jul 2 20:32:38 2005 UTC revision 1.18 by tromey, Sat Sep 17 21:58:41 2005 UTC
# Line 77  public final class Short extends Number Line 77  public final class Short extends Number
77    public static final Class TYPE = VMClassLoader.getPrimitiveClass('S');    public static final Class TYPE = VMClassLoader.getPrimitiveClass('S');
78    
79    /**    /**
80       * The number of bits needed to represent a <code>short</code>.
81       * @since 1.5
82       */
83      public static final int SIZE = 16;
84    
85      // This caches some Short values, and is used by boxing conversions
86      // via valueOf().  We must cache at least -128..127; these constants
87      // control how much we actually cache.
88      private static final int MIN_CACHE = -128;
89      private static final int MAX_CACHE = 127;
90      private static Short[] shortCache = new Short[MAX_CACHE - MIN_CACHE + 1];
91    
92      /**
93     * The immutable value of this Short.     * The immutable value of this Short.
94     *     *
95     * @serial the wrapped short     * @serial the wrapped short
# Line 350  public final class Short extends Number Line 363  public final class Short extends Number
363    {    {
364      return compareTo((Short)o);      return compareTo((Short)o);
365    }    }
366    
367      /**
368       * Reverse the bytes in val.
369       * @since 1.5
370       */
371      public static short reverseBytes(short val)
372      {
373        return (short) (((val >> 8) & 0xff) | ((val << 8) & 0xff00));
374      }
375  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26