Here you can find the source of convertLongToInt(long l)
Parameter | Description |
---|---|
l | the value to convert |
public static int convertLongToInt(long l)
//package com.java2s; //License from project: Apache License public class Main { /**/*ww w . j av a 2 s . c o m*/ * Convert a long value to an int value. Values larger than the biggest int * value is converted to the biggest int value, and values smaller than the * smallest int value are converted to the smallest int value. * * @param l the value to convert * @return the converted int value */ public static int convertLongToInt(long l) { if (l <= Integer.MIN_VALUE) { return Integer.MIN_VALUE; } else if (l >= Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else { return (int) l; } } }