Here you can find the source of toInteger(Object cell)
public static Integer toInteger(Object cell)
//package com.java2s; //License from project: Open Source License public class Main { public static Integer toInteger(Object cell) { if (cell instanceof Long) { return ((Long) cell).intValue(); } else if (cell instanceof Integer) { return (Integer) cell; } else if (cell instanceof String) { return Integer.parseInt((String) cell); } else {/*from www . j a va 2 s. c o m*/ return null; } } }