home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / lang / Double.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  2.2 KB  |  88 lines

  1. package java.lang;
  2.  
  3. public final class Double extends Number {
  4.    public static final double POSITIVE_INFINITY = (double)Float.POSITIVE_INFINITY;
  5.    public static final double NEGATIVE_INFINITY = (double)Float.NEGATIVE_INFINITY;
  6.    public static final double NaN = NaN;
  7.    public static final double MAX_VALUE = 1.7976931348623157E308;
  8.    public static final double MIN_VALUE = longBitsToDouble(1L);
  9.    public static final Class TYPE = Class.getPrimitiveClass("double");
  10.    private double value;
  11.    private static final long serialVersionUID = -9172774392245257468L;
  12.  
  13.    public static String toString(double var0) {
  14.       return (new FloatingDecimal(var0)).toJavaFormatString();
  15.    }
  16.  
  17.    public static Double valueOf(String var0) throws NumberFormatException {
  18.       return new Double(valueOf0(var0));
  19.    }
  20.  
  21.    public static boolean isNaN(double var0) {
  22.       return var0 != var0;
  23.    }
  24.  
  25.    public static boolean isInfinite(double var0) {
  26.       return var0 == POSITIVE_INFINITY || var0 == NEGATIVE_INFINITY;
  27.    }
  28.  
  29.    public Double(double var1) {
  30.       this.value = var1;
  31.    }
  32.  
  33.    public Double(String var1) throws NumberFormatException {
  34.       this(valueOf(var1));
  35.    }
  36.  
  37.    public boolean isNaN() {
  38.       return isNaN(this.value);
  39.    }
  40.  
  41.    public boolean isInfinite() {
  42.       return isInfinite(this.value);
  43.    }
  44.  
  45.    public String toString() {
  46.       return String.valueOf(this.value);
  47.    }
  48.  
  49.    public byte byteValue() {
  50.       return (byte)((int)this.value);
  51.    }
  52.  
  53.    public short shortValue() {
  54.       return (short)((int)this.value);
  55.    }
  56.  
  57.    public int intValue() {
  58.       return (int)this.value;
  59.    }
  60.  
  61.    public long longValue() {
  62.       return (long)this.value;
  63.    }
  64.  
  65.    public float floatValue() {
  66.       return (float)this.value;
  67.    }
  68.  
  69.    public double doubleValue() {
  70.       return this.value;
  71.    }
  72.  
  73.    public int hashCode() {
  74.       long var1 = doubleToLongBits(this.value);
  75.       return (int)(var1 ^ var1 >> 32);
  76.    }
  77.  
  78.    public boolean equals(Object var1) {
  79.       return var1 != null && var1 instanceof Double && doubleToLongBits(((Double)var1).value) == doubleToLongBits(this.value);
  80.    }
  81.  
  82.    public static native long doubleToLongBits(double var0);
  83.  
  84.    public static native double longBitsToDouble(long var0);
  85.  
  86.    static native double valueOf0(String var0) throws NumberFormatException;
  87. }
  88.