List of utility methods to do Long Number Create
Long | toLong(Integer i) to Long if (i == null) { return null; return i.longValue(); |
Long[] | toLong(long[] array) Converts primitive long[] array to Long[] Long[] toArray = (array == null) ? new Long[0] : new Long[array.length]; for (int i = 0; i < toArray.length; i++) { toArray[i] = array[i]; return toArray; |
Long | toLong(Number n) to Long if (n == null) { return null; return n.longValue(); |
Long | toLong(Number n) Converts a Number to a Long. if (n == null) { return null; return n.longValue(); |
Long | toLong(Number num) Convert the given number into a Long instance. return (num == null) ? null : Long.valueOf(num.longValue());
|
long | toLong(Object _inStrObj) to Long if (_inStrObj == null || _inStrObj.toString().trim().equals("")) { return 0; } else { return Long.valueOf(_inStrObj.toString()).longValue(); |
long | toLong(Object _value, long _default) Converts a string to an integer, and if unable to do so, returns the default value if (_value == null) return _default; else if (_value instanceof Integer) return ((Integer) _value).longValue(); else if (_value instanceof Long) return ((Long) _value); else if (_value instanceof Double) return ((Double) _value).longValue(); ... |
Long | toLong(Object cell) to Long if (cell instanceof Long) { return ((Long) cell); } else if (cell instanceof Integer) { return new Long((Integer) cell); } else if (cell instanceof String) { return Double.valueOf((String) cell).longValue(); } else { return null; ... |
Long | toLong(Object expectInt) to Long if (expectInt != null) { try { return ((Number) expectInt).longValue(); } catch (ClassCastException e) { if (expectInt instanceof String) { try { return Long.parseLong((String) expectInt); } catch (NumberFormatException e1) { ... |
long | toLong(Object num) to Long long x; if (num instanceof Integer) { x = ((Integer) num).longValue(); } else if (num instanceof Double) { x = ((Double) num).longValue(); } else { x = (long) num; return x; |