Android XmlPullParser Value Get loadFloatArrayByParser(XmlPullParser parser)

Here you can find the source of loadFloatArrayByParser(XmlPullParser parser)

Description

load Float Array By Parser

Declaration

public static float[] loadFloatArrayByParser(XmlPullParser parser) 

Method Source Code

//package com.java2s;
import java.io.IOException;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {

    public static float[] loadFloatArrayByParser(XmlPullParser parser) {
        String line;//from  w ww .  j a  v a 2s  .  com
        try {
            line = parser.nextText();
            line = line.trim();
            line = line.replace("\\r\\n", " ");
            line = line.replace("\n", " ");
            String[] szStrings = line.split("[ ]+");
            int length = szStrings.length;
            float[] re = new float[length];
            for (int i = 0; i < length; i++) {
                re[i] = Float.parseFloat(szStrings[i]);
            }
            return re;
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getPITarget(XmlPullParser pp)
  2. getPITarget(XmlPullParser pp)
  3. getRequiredAttributeValue(XmlPullParser pp, String namespace, String name)
  4. getRequiredAttributeValue(XmlPullParser pp, String namespace, String name)
  5. getValuesMap(XmlPullParser parser)
  6. loadFloatByParser(XmlPullParser parser)
  7. loadIntArrayByParser(XmlPullParser parser)
  8. loadStringArrayByParser(XmlPullParser parser)
  9. GetFullName(XmlPullParser reader)