net.sf.seaf.util.convert.simple
Class ConverterToInteger

java.lang.Object
  extended by net.sf.seaf.util.convert.simple.ConverterToInteger

public class ConverterToInteger
extends Object

Converter of any Object to Integer.


Constructor Summary
ConverterToInteger()
           
 
Method Summary
static Integer convert(Object o)
          Converts an Object to Integer value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterToInteger

public ConverterToInteger()
Method Detail

convert

public static Integer convert(Object o)
                       throws NumberFormatException
Converts an Object to Integer value.

Keeps null as null. Floating point number is cut to its intValue(). Boolean is converted to 1 or 0. Throws NumberFormatException if cannot be parsed.

Parameters:
o - Object to be converted
Returns:
Integer
Throws:
NumberFormatException - Thrown when the argument cannot be converted to Integer


Copyright © 2008-2011 SEAF. All Rights Reserved.