Java Utililty Methods Object to Float

List of utility methods to do Object to Float

Description

The list of methods to do Object to Float are organized into topic(s).

Method

floatcastToFloat(final double v)
Cast Double to Float.
if ((v < Float.MIN_VALUE) || (v > Float.MAX_VALUE)) {
    throw new ArithmeticException("Double value is out of Float range: " + v);
return (float) v;
FloatcastToFloat(final String uid)
cast To Float
try {
    return Float.parseFloat(uid);
} catch (NumberFormatException nfe) {
    return null;
FloatobjectToFloat(Object o)
Convert an object to a Float.
if (o == null) {
    return null;
if (o instanceof Float) {
    return (Float) o;
try {
    return Float.valueOf(o.toString());
...
floatobjectToFloat(Object obj)
object To Float
return objectToFloat(obj, 0f);
intobjectToInt(Object o)
object To Int
if (o instanceof Number)
    return ((Number) o).intValue();
try {
    if (o == null)
        return -1;
    else
        return Integer.parseInt(o.toString());
} catch (NumberFormatException e) {
...
intobjectToInt(Object o)
object To Int
if (o instanceof String) {
    return Integer.parseInt((String) o);
} else if (o instanceof Integer) {
    return ((Integer) o).intValue();
} else {
    throw new Exception("Invalid option value " + o);
intobjectToInt(Object obj)
object To Int
if (null == obj) {
    return 0;
try {
    if (obj instanceof String) {
        return Integer.parseInt((String) obj);
    } else if (obj instanceof Integer) {
        return (Integer) obj;
...
intobjectToInt(Object Obj)
object To Int
int NumInt = Integer.parseInt(objectToString(Obj));
return NumInt;
intobjectToInt(Object obj)
object To Int
return objectToInt(obj, 0);
intobjectToInt(Object p1)
object To Int
if (p1 == null) {
    return 0;
if (p1 instanceof Character) {
    return (int) ((Character) p1).charValue();
return ((Number) p1).intValue();