@Test public void testGetLong() throws Exception { long test_long = WXUtils.getLong("8098px"); assertEquals(8098, test_long); }
@Deprecated public static long getLong(Object value) { if (value == null) { return 0; } long result = 0; String temp = value.toString().trim(); if (temp.endsWith("wx")) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.w("the value of " + value + " use wx unit, which will be not supported soon after."); } try { return (long)transferWx(temp, 750); } catch (NumberFormatException e) { WXLogUtils.e("Argument format error! value is " + value, e); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else if (temp.endsWith("px")) { try { temp = temp.substring(0, temp.indexOf("px")); return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else { try { return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } } return result; }
WXUtils { @Deprecated public static long getLong(Object value) { if (value == null) { return 0; } long result = 0; String temp = value.toString().trim(); if (temp.endsWith("wx")) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.w("the value of " + value + " use wx unit, which will be not supported soon after."); } try { return (long)transferWx(temp, 750); } catch (NumberFormatException e) { WXLogUtils.e("Argument format error! value is " + value, e); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else if (temp.endsWith("px")) { try { temp = temp.substring(0, temp.indexOf("px")); return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else { try { return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } } return result; } }
WXUtils { @Deprecated public static long getLong(Object value) { if (value == null) { return 0; } long result = 0; String temp = value.toString().trim(); if (temp.endsWith("wx")) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.w("the value of " + value + " use wx unit, which will be not supported soon after."); } try { return (long)transferWx(temp, 750); } catch (NumberFormatException e) { WXLogUtils.e("Argument format error! value is " + value, e); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else if (temp.endsWith("px")) { try { temp = temp.substring(0, temp.indexOf("px")); return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else { try { return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } } return result; }  }
WXUtils { @Deprecated public static long getLong(Object value) { if (value == null) { return 0; } long result = 0; String temp = value.toString().trim(); if (temp.endsWith("wx")) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.w("the value of " + value + " use wx unit, which will be not supported soon after."); } try { return (long)transferWx(temp, 750); } catch (NumberFormatException e) { WXLogUtils.e("Argument format error! value is " + value, e); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else if (temp.endsWith("px")) { try { temp = temp.substring(0, temp.indexOf("px")); return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else { try { return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } } return result; }  static boolean isUiThread(); static boolean isUndefined(float value); static float getFloatByViewport(Object value, int viewport); static float getFloat(Object value); static Float getFloat(Object value, @Nullable Float df); static float fastGetFloat(String raw, int precision); static float fastGetFloat(String raw); static int parseInt(String value); static int parseInt(Object value); static float parseFloat(Object value); static float parseFloat(String value); static int getInt(Object value); static Integer getInteger(@Nullable Object value, @Nullable Integer df); @Deprecated static long getLong(Object value); @Deprecated static double getDouble(Object value); static boolean isTabletDevice(); static Boolean getBoolean(@Nullable Object value, @Nullable Boolean df); static long getAvailMemory(Context context); static String getString(@Nullable Object value,@Nullable String df); static int parseUnitOrPercent(String raw, int unit); static String getBundleBanner(String content); static int getNumberInt(Object value, int defaultValue); }
WXUtils { @Deprecated public static long getLong(Object value) { if (value == null) { return 0; } long result = 0; String temp = value.toString().trim(); if (temp.endsWith("wx")) { if (WXEnvironment.isApkDebugable()) { WXLogUtils.w("the value of " + value + " use wx unit, which will be not supported soon after."); } try { return (long)transferWx(temp, 750); } catch (NumberFormatException e) { WXLogUtils.e("Argument format error! value is " + value, e); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else if (temp.endsWith("px")) { try { temp = temp.substring(0, temp.indexOf("px")); return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } }else { try { return Long.parseLong(temp); } catch (NumberFormatException nfe) { WXLogUtils.e("Argument format error! value is " + value, nfe); } catch (Exception e) { WXLogUtils.e("Argument error! value is " + value, e); } } return result; }  static boolean isUiThread(); static boolean isUndefined(float value); static float getFloatByViewport(Object value, int viewport); static float getFloat(Object value); static Float getFloat(Object value, @Nullable Float df); static float fastGetFloat(String raw, int precision); static float fastGetFloat(String raw); static int parseInt(String value); static int parseInt(Object value); static float parseFloat(Object value); static float parseFloat(String value); static int getInt(Object value); static Integer getInteger(@Nullable Object value, @Nullable Integer df); @Deprecated static long getLong(Object value); @Deprecated static double getDouble(Object value); static boolean isTabletDevice(); static Boolean getBoolean(@Nullable Object value, @Nullable Boolean df); static long getAvailMemory(Context context); static String getString(@Nullable Object value,@Nullable String df); static int parseUnitOrPercent(String raw, int unit); static String getBundleBanner(String content); static int getNumberInt(Object value, int defaultValue); static final char PERCENT; }