public void run() { if (som == null || ((som.getLabels() == null || som.voronoiSet == null) && artterms == null)) return; // check if termvector information is available -> if not: crawl if (artterms == null) { // System.out.println("do the crawl..."); // artists are contained in labels (-> collect) Set<String> artistset = new HashSet<String>(); for (int i = 0; i < som.getNumberOfColumns(); i++) { // for each column in codebook for (int j = 0; j < som.getNumberOfRows(); j++) { // for each row in codebook Vector temp = (Vector) som.voronoiSet.elementAt(i * som.getNumberOfRows() + j); // read all labels in Voronoi-Set of current map unit for (int k = 0; k < temp.size(); k++) { Integer labelIndex = (Integer) temp.elementAt(k); artistset.add(som.getLabel(labelIndex.intValue())); } } } String[] artists = artistset.toArray(new String[artistset.size()]); wtet = new WebTermExtractionThread(artists, queryconstraint); wtet.addThreadListener(this); wtet.start(); // -> threadEnded } else { System.out.println("data already present."); this.threadEnded(); } }