List of utility methods to do Long Number Create
long | toLong(final String bitString) Convert a bit string into a long value. assert (bitString.length() <= Long.SIZE); long value = 0; for (final char ch : bitString.toCharArray()) { if (ch == '1') { value = value << 1; value = value | 1; } else if (ch == '0') { value = value << 1; ... |
long | toLong(final String str, final long defaultValue) Convert a If the string is NumberUtils.toLong(null, 1L) = 1L NumberUtils.toLong("", 1L) = 1L NumberUtils.toLong("1", 0L) = 1L if (str == null) { return defaultValue; try { return Long.parseLong(str); } catch (final NumberFormatException nfe) { return defaultValue; |
Long | toLong(final String value) Converts a String to a long plus if the String is NULL, the returned value will be NULL. if (value == null) { return null; return Long.valueOf(value); |
Long | toLong(final String value) create Long from str. return Long.parseLong(value);
|
long | toLong(final String value) To long. if (value == null) { return 0L; String szTemp = ""; for (int i = 0; i < value.length(); i++) if (value.charAt(i) != ',') { szTemp = szTemp + value.charAt(i); try { final double dd = Double.parseDouble(szTemp); final long l1 = (long) dd; return l1; } catch (final NumberFormatException e) { final long l = 0L; return l; |
byte[] | toLong(int numBytes, long value) Big endian. byte val[] = new byte[numBytes]; toLong(val, 0, numBytes, value); return val; |
long | toLong(int value) Returns the value of the given int as a long , when treated as unsigned. return value & INT_MASK;
|
long | toLong(int x, int z) Shift two int's together to form a compund key return ((long) x << 32) + z - Integer.MIN_VALUE; |
long[] | toLong(int[] a) to Long long[] b = new long[a.length]; for (int i = 0; i < a.length; i++) { b[i] = a[i]; return b; |
long | toLong(int[] x, int length, int M) to Long long a = 0; for (int i = 0; i < length; i++) { a |= ((long) x[i] << (M * i)); return a; |