List of utility methods to do Long to Int
int | long2int(final long l) Returns the hash code that would be returned by Long#hashCode() . return (int) (l ^ (l >>> 32)); |
int | long2int(final long l) longint return (int) (l ^ (l >>> 32)); |
int | long2int(final long l) Returns the int value that is closest to l. int m; if (l < (m = Integer.MAX_VALUE) && l > (m = Integer.MIN_VALUE)) return (int) l; return m; |
int | long2Int(final long v) long Int if (MAX_INT_VALUE < v) { throw new IllegalArgumentException( "Read uint32 value " + toHexString(v) + " > int32-max " + toHexString(MAX_INT_VALUE)); return (int) v; |
int[] | long2int(final long[] a) longint final int[] i = new int[a.length]; for (int d = 0; d < a.length; ++d) i[d] = (int) a[d]; return i; |
int | Long2Int(long i) Long Int int o; try { o = new Long(i).intValue(); } catch (Exception e) { o = 0; return o; |
Integer | long2int(Long source) Converts a long to an integer, for comparison purposes. return source > Integer.MAX_VALUE ? Integer.MAX_VALUE
: source < Integer.MIN_VALUE ? Integer.MIN_VALUE : Integer.valueOf(source.toString());
|
int | longToInt(final Long l, final String name, final int deflt) long To Int if (l == null) { return deflt; if (l > Integer.MAX_VALUE) { throw new IllegalArgumentException(name + " can be no greater than " + Integer.MAX_VALUE); return new Long(l).intValue(); |
int | longToInt(long d) long To Int int lo = 0; try { lo = Integer.parseInt(String.valueOf(d)); } catch (Exception e) { lo = 0; return lo; |
int | longToInt(long l) long To Int if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) { throw new IllegalArgumentException(l + " cannot be cast to int"); return (int) l; |