Hello
I'am trying to use some values that I get returned from the Html Parser.
Iam fetching the number of comments and it is stored in s, which should be an ArrayList.
Printing the values from "s" shows up just fine and in a neat little list.
But when Iam trying to use this to specify the size of a sphere with this is just says. "The Type of the expression must be an array type but it resolved to ArrayList"
What Iam I doing wrong ?
Any help would be appreciated since Iam very confused about this and just cant get it to work.
Code:
import processing.net.*;
import org.htmlparser.*;
import org.htmlparser.util.*;
import org.htmlparser.filters.*;
import org.htmlparser.nodes.*;
Client c;
String data;
// variables to navigate the generated data structure
int nrofnodes = 0;
ArrayList elements = new ArrayList();
ArrayList parents = new ArrayList();
ArrayList l = new ArrayList();
ArrayList s = new ArrayList();
int nodesAdded = 0;
int maxDegree = 0;
// Simply point to a site on your own server that gets the html from any other site.
private String urlPath = "TheWebsiteUrlwhichIcouldntIncludeinThepost";
private String content;
void setup() {
size(600, 400, P3D);
background(50);
fill(200);
smooth();
this.getDataFromClient();
for (int i = 0; i < nrofnodes; i++)
{
if (((TagNode)elements.get(i)).getTagName().equals("A"))
if (((LinkTag)elements.get(i)).getLinkText().indexOf("Comments") > 0)
{
String s = ((LinkTag)elements.get(i)).getLinkText() ;
int temp = s.indexOf("Comments");
s = s.substring(0 , temp-1);
s = s.replace("1,","1");
int nrofcom = Integer.valueOf( s );
// l.add(new temp(nrofcom, l));
String l = ((LinkTag)elements.get(i)).getLink() ;
println(s+" "+l);
}
}
}
void draw() {
translate(60,60,0);
sphere(s[1]);
}