Example usage for android.util JsonToken equals

List of usage examples for android.util JsonToken equals

Introduction

In this page you can find the example usage for android.util JsonToken equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:com.thingsee.tracker.REST.KiiBucketRequestAsyncTask.java

private JSONObject readSingleData(JsonReader jsonReader) throws IOException, JSONException {
    JSONObject jsonObject = new JSONObject();
    jsonReader.beginObject();/* w ww. j av  a2s.  c o  m*/
    JsonToken token;
    do {
        String name = jsonReader.nextName();
        if ("sId".equals(name)) {
            jsonObject.put("sId", jsonReader.nextString());
        } else if ("val".equals(name)) {
            jsonObject.put("val", jsonReader.nextDouble());
        } else if ("ts".equals(name)) {
            jsonObject.put("ts", jsonReader.nextLong());
        } else if ("_owner".equals(name)) {
            jsonObject.put("_owner", jsonReader.nextString());
        }

        token = jsonReader.peek();
    } while (token != null && !token.equals(JsonToken.END_OBJECT));
    jsonReader.endObject();
    return jsonObject;
}