Package se.sics.json

Examples of se.sics.json.JSONArray


    public boolean isConnected() {
        return !isConnected;
    }

    String[] getNodes(JSONObject json) {
        JSONArray nodes;
        String node;
        String[] nString = null;
        if ((nodes = json.getJSONArray("node")) != null) {
            nString = new String[nodes.size()];
            for(int i = 0, n = nodes.size(); i < n; i++) {
                node = nodes.getAsString(i);
                nString[i] = node;
            }
        } else if ((node = json.getAsString("node")) != null) {
            nString = new String[1];
            nString[0] = node;
View Full Code Here


            sendToSimulator("{\"response\":\"write\",\"data\":1}");
        } else if ("remove".equals(event)) {
            // TODO remove nodes
        } else if ("serial".equals(event)) {
            int data = json.getAsInt("data", -1);
            JSONArray nodes;
            String node;
            if (data < 0) {
                // No data - ignore serial event
            } else if ((nodes = json.getJSONArray("node")) != null) {
                for(int i = 0, n = nodes.size(); i < n; i++) {
                    node = nodes.getAsString(i);
                    if (node != null) {
                        sendSerialToNode(node, data);
                    }
                }
            } else if ((node = json.getAsString("node")) != null) {
View Full Code Here

TOP

Related Classes of se.sics.json.JSONArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.