Package org.zkforge.json.simple

Examples of org.zkforge.json.simple.JSONObject


    static DecimalFormat static_nf = new DecimalFormat(".####");

    @SuppressWarnings("unchecked")
    public String toString()
    {
        JSONObject json = new JSONObject();
        json.put("id", String.valueOf(getId()));
        TimeZone zone = Calendar.getInstance().getTimeZone();
        timeformat.setTimeZone(zone);
        String formattedTime = timeformat.format(getTime());
        json.put("time", formattedTime);
        if (getValue() < 0)
        {
            json.put("value", "NaN");
        }
        else
        {
            json.put("value", static_nf.format(getValue()));
        }
//        if (getReliability() < 0)
//        {
//            json.put("reliability", "NaN");
//        }
//        else
//        {
//            json.put("reliability", static_nf.format(getReliability()));
//        }
//        System.out.println(json.toString());
        return json.toString();
    }
View Full Code Here

TOP

Related Classes of org.zkforge.json.simple.JSONObject

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.