Kyle
unread,Apr 12, 2011, 3:55:52 AM4/12/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-gson
Hey everyone, so I have been dealing with an issue deserializing my
object. I get the feeling that I am not creating the object correctly,
so here is what I have.
The structure I am attempting to put the data into follows this style.
{
"series": [{
"data":[[long,long], ... ],
"label":String
},{
"data":[[long,long], ... ],
"label":String
},
...
],
"options:{
"mouse":{"track":true},
"xaxis":{"noTicks":10},
"points":{"show":true},
"lines":{"show":true}
}
}
My attempt at doing this looks something like this:
class JsonBlock {
List<Series> series = new ArrayList<Series>();
}
class Series {
List<long[]> data = new ArrayList<long[]>();
String label = "";
public Series(String label, long[] d) { this.label = label;
data.add(d); }
}