publicinthashCode(){//hash預設是0int h = hash;if(h ==0&& value.length >0){char val[]= value;for(int i =0; i < value.length; i++){
h =31* h + val[i];}
hash = h;}return h;}
publicstaticinthashCode(double value){long bits =doubleToLongBits(value);return(int)(bits ^(bits >>>32));}publicstaticlongdoubleToLongBits(double value){long result =doubleToRawLongBits(value);// Check for NaN based on values of bit fields, maximum// exponent and nonzero significand.if(((result & DoubleConsts.EXP_BIT_MASK)==
DoubleConsts.EXP_BIT_MASK)&&(result & DoubleConsts.SIGNIF_BIT_MASK)!=0L)
result =0x7ff8000000000000L;return result;}publicstaticnativelongdoubleToRawLongBits(double value);publicstaticfinallong SIGN_BIT_MASK =-9223372036854775808L;publicstaticfinallong EXP_BIT_MASK =9218868437227405312L;publicstaticfinallong SIGNIF_BIT_MASK =4503599627370495L;