Here you can find the source of doubleToInt(double d, int defaultValue)
public static int doubleToInt(double d, int defaultValue)
//package com.java2s; //License from project: LGPL public class Main { public static int doubleToInt(double d, int defaultValue) { if (d >= Integer.MIN_VALUE && d <= Integer.MAX_VALUE) { return (int) d; }//from www. ja v a2 s .c om return defaultValue; } }