src/share/classes/java/lang/Integer.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 676,695 ****
public Integer(String s) throws NumberFormatException {
this.value = parseInt(s, 10);
}
/**
! * Returns the value of this {@code Integer} as a
! * {@code byte}.
*/
public byte byteValue() {
return (byte)value;
}
/**
! * Returns the value of this {@code Integer} as a
! * {@code short}.
*/
public short shortValue() {
return (short)value;
}
--- 676,697 ----
public Integer(String s) throws NumberFormatException {
this.value = parseInt(s, 10);
}
/**
! * Returns the value of this {@code Integer} as a {@code byte}
! * after a narrowing primitive conversion.
! * @jls 5.1.3 Narrowing Primitive Conversions
*/
public byte byteValue() {
return (byte)value;
}
/**
! * Returns the value of this {@code Integer} as a {@code short}
! * after a narrowing primitive conversion.
! * @jls 5.1.3 Narrowing Primitive Conversions
*/
public short shortValue() {
return (short)value;
}
*** 700,727 ****
public int intValue() {
return value;
}
/**
! * Returns the value of this {@code Integer} as a
! * {@code long}.
*/
public long longValue() {
return (long)value;
}
/**
! * Returns the value of this {@code Integer} as a
! * {@code float}.
*/
public float floatValue() {
return (float)value;
}
/**
! * Returns the value of this {@code Integer} as a
! * {@code double}.
*/
public double doubleValue() {
return (double)value;
}
--- 702,732 ----
public int intValue() {
return value;
}
/**
! * Returns the value of this {@code Integer} as a {@code long}
! * after a widening primitive conversion.
! * @jls 5.1.2 Widening Primitive Conversions
*/
public long longValue() {
return (long)value;
}
/**
! * Returns the value of this {@code Integer} as a {@code float}
! * after a widening primitive conversion.
! * @jls 5.1.2 Widening Primitive Conversions
*/
public float floatValue() {
return (float)value;
}
/**
! * Returns the value of this {@code Integer} as a {@code double}
! * after a widening primitive conversion.
! * @jls 5.1.2 Widening Primitive Conversions
*/
public double doubleValue() {
return (double)value;
}