jdk/src/share/classes/java/lang/Short.java
changeset 18546 862067c6481c
parent 14507 066419d1e732
child 21334 c60dfce46a77
equal deleted inserted replaced
18545:5f4e734fad1b 18546:862067c6481c
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   401 
   401 
   402     /**
   402     /**
   403      * Returns a hash code for a {@code short} value; compatible with
   403      * Returns a hash code for a {@code short} value; compatible with
   404      * {@code Short.hashCode()}.
   404      * {@code Short.hashCode()}.
   405      *
   405      *
       
   406      * @param value the value to hash
       
   407      * @return a hash code value for a {@code short} value.
   406      * @since 1.8
   408      * @since 1.8
   407      *
       
   408      * @return a hash code value for a {@code short} value.
       
   409      */
   409      */
   410     public static int hashCode(short value) {
   410     public static int hashCode(short value) {
   411         return (int)value;
   411         return (int)value;
   412     }
   412     }
   413 
   413 
   480 
   480 
   481     /**
   481     /**
   482      * Returns the value obtained by reversing the order of the bytes in the
   482      * Returns the value obtained by reversing the order of the bytes in the
   483      * two's complement representation of the specified {@code short} value.
   483      * two's complement representation of the specified {@code short} value.
   484      *
   484      *
       
   485      * @param i the value whose bytes are to be reversed
   485      * @return the value obtained by reversing (or, equivalently, swapping)
   486      * @return the value obtained by reversing (or, equivalently, swapping)
   486      *     the bytes in the specified {@code short} value.
   487      *     the bytes in the specified {@code short} value.
   487      * @since 1.5
   488      * @since 1.5
   488      */
   489      */
   489     public static short reverseBytes(short i) {
   490     public static short reverseBytes(short i) {