/[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.18 by tromey, Sat Sep 17 21:58:41 2005 UTC revision 1.19 by tromey, Sun Sep 18 23:00:24 2005 UTC
# Line 202  public final class Short extends Number Line 202  public final class Short extends Number
202    }    }
203    
204    /**    /**
205       * Returns a <code>Short</code> object wrapping the value.
206       * In contrast to the <code>Short</code> constructor, this method
207       * will cache some values.  It is used by boxing conversion.
208       *
209       * @param val the value to wrap
210       * @return the <code>Short</code>
211       *
212       * @since 1.5
213       */
214      public static Short valueOf(short val)
215      {
216        if (val < MIN_CACHE || val > MAX_CACHE)
217          return new Short(val);
218        synchronized (shortCache)
219          {
220        if (shortCache[val - MIN_CACHE] == null)
221          shortCache[val - MIN_CACHE] = new Short(val);
222        return shortCache[val - MIN_CACHE];
223          }
224      }
225    
226      /**
227     * Convert the specified <code>String</code> into a <code>Short</code>.     * Convert the specified <code>String</code> into a <code>Short</code>.
228     * The <code>String</code> may represent decimal, hexadecimal, or     * The <code>String</code> may represent decimal, hexadecimal, or
229     * octal numbers.     * octal numbers.

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

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