Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package de.padde.gpstest; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; class MyPhoneNumber { private String number; private int type; public MyPhoneNumber(String n, int t) { this.number = n; this.type = t; } public String toJSON() { JSONObject nr = new JSONObject(); try { nr.put("number", this.number); nr.put("type", this.type); return nr.toString(); } catch (JSONException e) {} return null; } public String toString() { return "Number -> "+this.number+"ntType -> "+this.type; } } public class MyPerson { private static int count = 0; private static ArrayList persons = new ArrayList(); private int id; private String name; private String adress; private ArrayList numbers; public MyPerson(String n, String a) { this.name = n; this.adress = a; this.numbers = new ArrayList(); this.id = MyPerson.count++; MyPerson.persons.add(this); } public void addPhone(String number, int type) { numbers.add(new MyPhoneNumber(number,type)); } public String toJSON() { JSONObject mp = new JSONObject(); JSONArray nrs = new JSONArray(); for(MyPhoneNumber mpnr : this.numbers) { try { nrs.put(new JSONObject(mpnr.toJSON())); } catch (JSONException e) { } } try { mp.put("id", this.id); mp.put("name", this.name); mp.put("adress", this.adress); mp.put("numbers", nrs); return mp.toString(); } catch (JSONException e) {} return null; } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Id -> "+this.id+"n"); sb.append("Name -> "+this.name+"n"); sb.append("Adress -> "+this.adress+"n"); sb.append("Numbers: n"); for(MyPhoneNumber mpnr : this.numbers) { sb.append("t"+mpnr.toString()+"n"); } return sb.toString(); } public static String AllToJSON() { JSONArray jpersons = new JSONArray(); for(MyPerson p : MyPerson.persons) { try { jpersons.put(new JSONObject(p.toJSON())); } catch (JSONException e) {} } return jpersons.toString(); } public static String AllToString() { StringBuffer sb = new StringBuffer(); for(MyPerson p : MyPerson.persons) { sb.append(p.toString()+"n"); } return (sb.length() == 0) ? "null" : sb.toString(); } public static void reset() { MyPerson.count = 0; MyPerson.persons.clear(); } public static void fromJSON(String json) { try { JSONArray persons = new JSONArray(json); JSONArray numbers; JSONObject person; JSONObject number; MyPerson mp; for(int i=0; i < persons.length(); i++) { person = persons.getJSONObject(i); mp = new MyPerson(person.getString("name"), person.getString("adress")); numbers = person.getJSONArray("numbers"); for(int x=0; x < numbers.length(); x++) { number = numbers.getJSONObject(x); mp.addPhone(number.getString("number"), number.getInt("type")); } } } catch (JSONException e) {} } }