Java Utililty Methods Long Number From

List of utility methods to do Long Number From

Description

The list of methods to do Long Number From are organized into topic(s).

Method

long[]toLongs(int[] array)
to Longs
long[] ret = new long[array.length];
for (int e = 0; e < array.length; e++) {
    ret[e] = array[e];
return ret;
long[]toLongs(Long[] values)
to Longs
return toLongs(values, DEFAULT_LONG);
longtoLongTime()
to Long Time
return System.currentTimeMillis();
LongtoLongTimestamp(Object cell)
to Long Timestamp
if (cell instanceof String) {
    Double d = Double.valueOf((String) cell);
    d = new Double(d * 1000d);
    return d.longValue();
} else {
    return null;
longtoLongUnsigned(int intValue)
Convert a signed int to a unsigned value in a long
long mask = 0x7fffffff;
mask += (long) 1 << 31;
return (intValue & mask);
longtoLongValue(byte... bytes)
to Long Value
return toLongValue(bytes, 0, bytes.length);
longtoLongValue(final Object o)
to Long Value
if (o instanceof Long)
    return ((Long) o).longValue();
return 0;
LongtoLongValue(final String candidateString)

Parses the given candidate string into a Long .

Long result;
if (candidateString == null || candidateString.length() == 0)
    throw new NumberFormatException("Cannot parse zero length string.");
String longTxtVal = candidateString;
if (longTxtVal.length() > 2 && (longTxtVal.endsWith("l") || longTxtVal.endsWith("L")))
    longTxtVal = longTxtVal.substring(0, longTxtVal.length() - 1);
result = new Long(longTxtVal);
return result;
...
LongtoLongValue(Object value)
to Long Value
if ((value == null) || (value.getClass() == Long.class)) {
    return (Long) value;
if (value instanceof Number) {
    return ((Number) value).longValue();
throw new IllegalArgumentException("value must be instance of Number.");