[API] java.lang.Integer :: 소림사의 홍반장!

[API] java.lang.Integer

2012. 8. 3. 11:57 - 삘쏘굿
java.lang

Class Integer

  • All Implemented Interfaces:
    Serializable, Comparable<Integer>


    public final class Integer
    extends Number
    implements Comparable<Integer>
    The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int.

    In addition, this class provides several methods for converting an int to a String and a String to an int, as well as other constants and methods useful when dealing with an int.

    Implementation note: The implementations of the "bit twiddling" methods (such as highestOneBit and numberOfTrailingZeros) are based on material from Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002).

    Since:
    JDK1.0
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int MAX_VALUE
      A constant holding the maximum value an int can have, 231-1.
      static int MIN_VALUE
      A constant holding the minimum value an int can have, -231.
      static int SIZE
      The number of bits used to represent an int value in two's complement binary form.
      static Class<Integer> TYPE
      The Class instance representing the primitive type int.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Integer(int value)
      Constructs a newly allocated Integer object that represents the specified int value.
      Integer(String s)
      Constructs a newly allocated Integer object that represents the int value indicated by the String parameter.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static int bitCount(int i)
      Returns the number of one-bits in the two's complement binary representation of the specified int value.
      byte byteValue()
      Returns the value of this Integer as a byte.
      static int compare(int x, int y)
      Compares two int values numerically.
      int compareTo(Integer anotherInteger)
      Compares two Integer objects numerically.
      static Integer decode(String nm)
      Decodes a String into an Integer.
      double doubleValue()
      Returns the value of this Integer as a double.
      boolean equals(Object obj)
      Compares this object to the specified object.
      float floatValue()
      Returns the value of this Integer as a float.
      static Integer getInteger(String nm)
      Determines the integer value of the system property with the specified name.
      static Integer getInteger(String nm, int val)
      Determines the integer value of the system property with the specified name.
      static Integer getInteger(String nm, Integer val)
      Returns the integer value of the system property with the specified name.
      int hashCode()
      Returns a hash code for this Integer.
      static int highestOneBit(int i)
      Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value.
      int intValue()
      Returns the value of this Integer as an int.
      long longValue()
      Returns the value of this Integer as a long.
      static int lowestOneBit(int i)
      Returns an int value with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specified int value.
      static int numberOfLeadingZeros(int i)
      Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified int value.
      static int numberOfTrailingZeros(int i)
      Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified int value.
      static int parseInt(String s)
      Parses the string argument as a signed decimal integer.
      static int parseInt(String s, int radix)
      Parses the string argument as a signed integer in the radix specified by the second argument.
      static int reverse(int i)
      Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified int value.
      static int reverseBytes(int i)
      Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified int value.
      static int rotateLeft(int i, int distance)
      Returns the value obtained by rotating the two's complement binary representation of the specified int value left by the specified number of bits.
      static int rotateRight(int i, int distance)
      Returns the value obtained by rotating the two's complement binary representation of the specified int value right by the specified number of bits.
      short shortValue()
      Returns the value of this Integer as a short.
      static int signum(int i)
      Returns the signum function of the specified int value.
      static String toBinaryString(int i)
      Returns a string representation of the integer argument as an unsigned integer in base 2.
      static String toHexString(int i)
      Returns a string representation of the integer argument as an unsigned integer in base 16.
      static String toOctalString(int i)
      Returns a string representation of the integer argument as an unsigned integer in base 8.
      String toString()
      Returns a String object representing this Integer's value.
      static String toString(int i)
      Returns a String object representing the specified integer.
      static String toString(int i, int radix)
      Returns a string representation of the first argument in the radix specified by the second argument.
      static Integer valueOf(int i)
      Returns an Integer instance representing the specified int value.
      static Integer valueOf(String s)
      Returns an Integer object holding the value of the specified String.
      static Integer valueOf(String s, int radix)
      Returns an Integer object holding the value extracted from the specified String when parsed with the radix given by the second argument.

'Dev. 자바 > API 및 이론' 카테고리의 다른 글

[JAVA API] java.util.Random  (0) 2012.08.03
[API] java.util.Calendar  (0) 2012.08.03
[API] java.lang.String  (0) 2012.08.03
[API] java.lang.Object  (0) 2012.08.03
자바 메모리 영역의 사용  (0) 2012.07.26

다른 카테고리의 글 목록

Dev. 자바/API 및 이론 카테고리의 포스트를 톺아봅니다