Here you can find the source of toLong(Object cell)
public static Long toLong(Object cell)
//package com.java2s; //License from project: Open Source License public class Main { public static Long toLong(Object cell) { if (cell instanceof Long) { return ((Long) cell); } else if (cell instanceof Integer) { return new Long((Integer) cell); } else if (cell instanceof String) { return Double.valueOf((String) cell).longValue(); } else {//from www .j ava 2 s . c om return null; } } }