Java Float Array Create toFloatByObject(Object obj)

Here you can find the source of toFloatByObject(Object obj)

Description

to Float By Object

License

Apache License

Declaration

public static Float toFloatByObject(Object obj) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static Float toFloatByObject(Object obj) {
        try {//from  ww w. j a v a2 s. c  om
            return Float.valueOf(toStringByObject(obj, true));
        } catch (Exception e) {
            return 0.0f;
        }
    }

    public static String toStringByObject(Object obj) {
        return toStringByObject(obj, false);
    }

    public static String toStringByObject(Object obj, boolean isqdkg) {
        if (obj == null) {
            return "";
        } else {
            if (isqdkg) {
                return obj.toString().trim();
            } else {
                return obj.toString();
            }

        }
    }
}

Related

  1. toFloatArray(Object[] arr)
  2. toFloatArray(String str, String separator)
  3. toFloatArray(String text, String delim)
  4. toFloatArray(String[] anArray)
  5. toFloatArrays(double[][] arrays)
  6. toFloatMatrix(int[][] m)
  7. toFloatRawBits(int i)
  8. toFloats(byte[] bytes)
  9. toFloats(byte[] value, int offset, int num)