From 40fe707e6566faa02eeba2e8f4830dbbd3992f4a Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Thu, 20 Jun 2013 18:52:48 +0700 Subject: Users.arrayToString --- src/com/juick/json/Users.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/com/juick/json/Users.java (limited to 'src') diff --git a/src/com/juick/json/Users.java b/src/com/juick/json/Users.java new file mode 100644 index 00000000..eda89ccb --- /dev/null +++ b/src/com/juick/json/Users.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.juick.json; + +import java.util.ArrayList; +import java.util.Iterator; + +/** + * + * @author ugnich + */ +public class Users { + + public static String arrayToString(ArrayList users) { + String json = "["; + + Iterator i = users.iterator(); + while (i.hasNext()) { + com.juick.User u = i.next(); + if (json.length() > 1) { + json += ","; + } + json += "{\"uid\":" + u.UID + ",\"uname\":\"" + u.UName + "\"}"; + } + + json += "]"; + return json; + } +} -- cgit v1.2.3