src/share/classes/java/lang/Integer.java

Print this page




 729 
 730     /**
 731      * Returns the value of this {@code Integer} as a
 732      * {@code double}.
 733      */
 734     public double doubleValue() {
 735         return (double)value;
 736     }
 737 
 738     /**
 739      * Returns a {@code String} object representing this
 740      * {@code Integer}'s value. The value is converted to signed
 741      * decimal representation and returned as a string, exactly as if
 742      * the integer value were given as an argument to the {@link
 743      * java.lang.Integer#toString(int)} method.
 744      *
 745      * @return  a string representation of the value of this object in
 746      *          base 10.
 747      */
 748     public String toString() {
 749         return String.valueOf(value);
 750     }
 751 
 752     /**
 753      * Returns a hash code for this {@code Integer}.
 754      *
 755      * @return  a hash code value for this object, equal to the
 756      *          primitive {@code int} value represented by this
 757      *          {@code Integer} object.
 758      */
 759     public int hashCode() {
 760         return value;
 761     }
 762 
 763     /**
 764      * Compares this object to the specified object.  The result is
 765      * {@code true} if and only if the argument is not
 766      * {@code null} and is an {@code Integer} object that
 767      * contains the same {@code int} value as this object.
 768      *
 769      * @param   obj   the object to compare with.




 729 
 730     /**
 731      * Returns the value of this {@code Integer} as a
 732      * {@code double}.
 733      */
 734     public double doubleValue() {
 735         return (double)value;
 736     }
 737 
 738     /**
 739      * Returns a {@code String} object representing this
 740      * {@code Integer}'s value. The value is converted to signed
 741      * decimal representation and returned as a string, exactly as if
 742      * the integer value were given as an argument to the {@link
 743      * java.lang.Integer#toString(int)} method.
 744      *
 745      * @return  a string representation of the value of this object in
 746      *          base 10.
 747      */
 748     public String toString() {
 749         return toString(value);
 750     }
 751 
 752     /**
 753      * Returns a hash code for this {@code Integer}.
 754      *
 755      * @return  a hash code value for this object, equal to the
 756      *          primitive {@code int} value represented by this
 757      *          {@code Integer} object.
 758      */
 759     public int hashCode() {
 760         return value;
 761     }
 762 
 763     /**
 764      * Compares this object to the specified object.  The result is
 765      * {@code true} if and only if the argument is not
 766      * {@code null} and is an {@code Integer} object that
 767      * contains the same {@code int} value as this object.
 768      *
 769      * @param   obj   the object to compare with.