Java Long Number Create toLong(Object cell)

Here you can find the source of toLong(Object cell)

Description

to Long

License

Open Source License

Declaration

public static Long toLong(Object cell) 

Method Source Code

//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;
        }
    }
}

Related

  1. toLong(Number n)
  2. toLong(Number n)
  3. toLong(Number num)
  4. toLong(Object _inStrObj)
  5. toLong(Object _value, long _default)
  6. toLong(Object expectInt)
  7. toLong(Object num)
  8. toLong(Object num, long defValue)
  9. toLong(Object number)