All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.eg.google.gson.internal.LazilyParsedNumber Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
 package com.eg.google.gson.internal;

 import java.io.ObjectStreamException;
 import java.math.BigDecimal;

 import static java.lang.Float.parseFloat;
 import static java.lang.Integer.parseInt;
 import static java.lang.Long.parseLong;


 public final class LazilyParsedNumber
   extends Number
 {
   private final String value;

   public LazilyParsedNumber(String value) {
       this.value = value;
   }

   public int intValue() {
       try {
/* 36 */
           return parseInt(this.value);
       } catch (NumberFormatException e) {
           try {
               return (int) parseLong(this.value);
           } catch (NumberFormatException nfe) {
           }
       }
       return new BigDecimal(this.value).intValue();
   }


   public long longValue() {
       try {
           return parseLong(this.value);
       } catch (NumberFormatException e) {
       }
       return new BigDecimal(this.value).longValue();
   }


   public float floatValue() {
       return parseFloat(this.value);
   }

   public double doubleValue()
   {
/* 62 */     return Double.parseDouble(this.value);
   }

   public String toString() {
       return this.value;
   }




   private Object writeReplace()
     throws ObjectStreamException
   {
/* 76 */     return new BigDecimal(this.value);
   }
 }


/* Location:              D:\Android_Agent\AndroidInstrumentation\SampleApp_RE_code\NewRelic_Android_Agent_5.8.3\newrelic-android-5.8.3\lib\newrelic.android.jar!\com.google.gson\internal\LazilyParsedNumber.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       0.7.1
 */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy