Here you can find the source of longToInt(long value)
Parameter | Description |
---|---|
value | value to convert |
public static int longToInt(long value)
//package com.java2s; /*//from w w w. ja v a 2 s .co m * Wegas * http://wegas.albasim.ch * * Copyright (c) 2013, 2014, 2015 School of Business and Engineering Vaud, Comem * Licensed under the MIT License */ public class Main { /** * Checked conversion from long to int * * @param value value to convert * @return value as int */ public static int longToInt(long value) { if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) { throw new IllegalArgumentException(value + " is out of Integer's bound"); } return (int) value; } }