Java Integer Create toInteger(Object cell)

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

Description

to Integer

License

Open Source License

Declaration

public static Integer toInteger(Object cell) 

Method Source Code

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

Related

  1. toInteger(Number n)
  2. toInteger(Number number)
  3. toInteger(Object _inStrObj)
  4. toInteger(Object _value, int _default)
  5. toInteger(Object anObj)
  6. toInteger(Object o)
  7. toInteger(Object o)
  8. toInteger(Object ob, Integer defaultInteger)
  9. toInteger(Object obj)